Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- #include <conio.h>
- #include <algorithm>
- #include <ctime>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- int liczba;
- int j = 0;
- string znaki= "";
- string litera = "P";
- for(int i = 0; i < 10; i++)
- {
- cout << endl;
- for (int j = 0; j < 10; j++)
- {
- liczba = rand()%101+0;
- if(liczba+17 == 77)
- {
- znaki += "@";
- cout << "@ ";
- }
- else
- {
- if(liczba%2 == 1)
- {
- znaki += "*";
- cout << "* ";
- }
- else if(liczba%2 == 0)
- {
- znaki+="#";
- cout << "# ";
- }
- }
- }
- }
- liczba = rand()%101+0;
- cout << endl << endl << endl;
- for(int i = 0; i < 10; i++)
- {
- cout << endl;
- for(int k = 0; k < 10; k++)
- {
- if(j == liczba)
- {
- znaki[j] = litera[0];
- }
- cout << znaki[j] << " ";
- j+=1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement