fork download
  1. #include<stdlib.h>
  2. #include<time.h>
  3. #include<iostream>
  4. using namespace std;
  5.  
  6. int kubik()
  7. {
  8. int q=1;
  9.  
  10. q = rand() % 6 + 1;
  11. return q;
  12. }
  13.  
  14. int main()
  15. {
  16. srand(time(NULL));
  17. char im[50];
  18. int e = 0;
  19. cout << "Vvedit vashe imia: ";
  20. cin >> im;
  21. do
  22. {
  23. cout << "\nHto hodit pershii?(0-wi, 1-kamputir):\n";
  24. cin >> e;
  25. switch (e)
  26. {
  27. case 0:
  28. cout << "nolek\n";
  29. break;
  30. case 1:
  31. cout << "adin\n";
  32. break;
  33. default:
  34. cout << "error! 0, 1 only\n";
  35. }
  36.  
  37. } while (e > 1);
  38.  
  39.  
  40. int t = kubik();
  41. cout << t << endl;
  42. t = kubik();
  43. cout << t << endl;
  44. t = kubik();
  45. cout << t << endl;
  46. t = kubik();
  47. cout << t << endl;
  48. t = kubik();
  49. cout << t << endl;
  50. t = kubik();
  51. cout << t << endl;
  52. system("pause");
  53. }
Success #stdin #stdout #stderr 0s 3344KB
stdin
asd
1
stdout
Vvedit vashe imia: 
Hto hodit pershii?(0-wi, 1-kamputir):
adin
6
6
5
3
4
4
stderr
sh: pause: not found