Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Determinant by Rule of Sarrus
- /*
- #include <iostream>
- #include <ctime>
- using std::cout;
- using std::cin;
- using std::endl;
- void main()
- {
- srand(time(0));
- const int n = 10;
- double matrix[n];
- for (int i = 0; i < n; ++i)
- matrix[i] = rand() % 20 - 10;
- for (int i = 0; i < n; ++i)
- {
- if
- cout << matrix[i] << '\t';
- }
- cout << endl << endl << endl << endl << endl;
- }
- */
- // Звездное небо
- // Звездное небо
- #include <iostream>
- #include <ctime>
- #include <Windows.h>
- using std::cout;
- using std::cin;
- using std::endl;
- void main()
- {
- srand(time(NULL));
- int x = 75, y = 25;
- int value;
- while (true)
- {
- for (int i = 0; i < 50; ++i)
- {
- for (int j = 0; j < 150; ++j)
- {
- if (i == y && j == x) cout << (char)254;
- else cout << ' ';
- }
- cout << endl;
- }
- value = rand() % 4;
- value == 1 ? x += 2 : value == 2 ? x -= 2 : value == 3 ? y += 2 : y -= 2;
- Sleep(200);
- system("cls");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement