Advertisement
kostes

Untitled

Mar 12th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. srand(time(NULL));
  10. int n,m,i,j,x,s,a[100][100];
  11. cout<<"kol-vo strok m=";
  12. cin>>m;
  13. cout<<"kol-vo stolbcov n=";
  14. cin>>n;
  15. cout<<"elementy"<<endl;
  16. for (i=0;i<m;i++)
  17. {
  18. for (j=0;j<n;j++)
  19. {
  20. cout.width(3);
  21. a[i][j] = -10 + rand()%21;
  22. cout<<a[i][j]<<" ";
  23. }
  24. cout<<endl;
  25. }
  26. for(int i=0;i<m;i++)
  27. {
  28. for(int j=0;j<n;j++)
  29. {
  30. if(a[i][j]==5)
  31. {
  32. cout<< "stroka "<<i<<" stolbec "<<j;
  33. return 0;
  34. }
  35. }
  36. }
  37. cout<<"takih net";
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement