Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- cout << "Losuje" << endl;
- int tablica[5][5];
- for(int i=0; i<5;i++)
- {
- for(int j=0;j<5;j++)
- {
- int los= 1+rand()%(10-1+1);
- tablica[i][j]= los;
- }
- }
- for(int i=0; i<5;i++)
- {
- for(int j=0;j<5;j++)
- {
- cout<<tablica[i][j]<<"\t";
- }
- cout<<endl;
- }
- int liczba;
- cout<<"Podaj liczbe do sprawdzenia: ";
- cin>>liczba;
- cout<<endl;
- for(int i=0; i<5;i++)
- {
- for(int j=0;j<5;j++)
- {
- if(tablica[i][j]==liczba)
- cout<<"["<<i<<"]"<<"["<<j<<"]"<<endl;
- }
- //cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement