Advertisement
HyperSensualNarwhal

lo

Jan 5th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1. // Determinant by Rule of Sarrus
  2.  
  3. /*
  4. #include <iostream>
  5. #include <ctime>
  6.  
  7. using std::cout;
  8. using std::cin;
  9. using std::endl;
  10.  
  11. void main()
  12. {
  13.  
  14.     srand(time(0));
  15.  
  16.     const int n = 10;
  17.     double matrix[n];
  18.  
  19.     for (int i = 0; i < n; ++i)
  20.         matrix[i] = rand() % 20 - 10;
  21.  
  22.     for (int i = 0; i < n; ++i)
  23.     {
  24.         if
  25.         cout << matrix[i] << '\t';
  26.     }
  27.  
  28.     cout << endl << endl << endl << endl << endl;
  29. }
  30. */
  31.  
  32.  
  33. // Звездное небо
  34.  
  35. // Звездное небо
  36.  
  37. #include <iostream>
  38. #include <ctime>
  39. #include <Windows.h>
  40.  
  41. using std::cout;
  42. using std::cin;
  43. using std::endl;
  44.  
  45. void main()
  46. {
  47.     srand(time(NULL));
  48.  
  49.     int x = 75, y = 25;
  50.     int value;
  51.  
  52.     while (true)
  53.     {
  54.  
  55.        
  56.  
  57.         for (int i = 0; i < 50; ++i)
  58.         {
  59.             for (int j = 0; j < 150; ++j)
  60.                 {
  61.                     if (i == y && j == x) cout << (char)254;
  62.                     else cout << ' ';
  63.                 }
  64.             cout << endl;  
  65.         }
  66.        
  67.  
  68.         value = rand() % 4;
  69.         value == 1 ? x += 2 : value == 2 ? x -= 2 : value == 3 ? y += 2 : y -= 2;
  70.  
  71.         Sleep(200);
  72.         system("cls");
  73.     }
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement