Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- int n,m,i,j,x,s,a[100][100];
- cout<<"kol-vo strok m=";
- cin>>m;
- cout<<"kol-vo stolbcov n=";
- cin>>n;
- cout<<"elementy"<<endl;
- for (i=0;i<m;i++)
- {
- for (j=0;j<n;j++)
- {
- cout.width(3);
- a[i][j] = -10 + rand()%21;
- cout<<a[i][j]<<" ";
- }
- cout<<endl;
- }
- for(int i=0;i<m;i++)
- {
- for(int j=0;j<n;j++)
- {
- if(a[i][j]==5)
- {
- cout<< "stroka "<<i<<" stolbec "<<j;
- return 0;
- }
- }
- }
- cout<<"takih net";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement