Advertisement
Guest User

mtp

a guest
Nov 21st, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <ctime>
  4. #include <windows.h>
  5. using namespace std;
  6. int main(int argc, char** argv) {
  7. int t[10][10],i=0,a=0,s=0,sw=0;
  8. srand(time(NULL));
  9. for(i=0;i<10;i++)
  10. {
  11. cout<<endl;
  12. for(a=0;a<10;a++)
  13. {
  14. t[i][a]= (rand()%201)-100;
  15. cout<<t[i][a]<<" ";
  16. }
  17. }
  18. for(i=0;i<10;i++)
  19. {
  20. for(a=0;a<10;a++)
  21. {
  22. s=s+t[i][a];
  23. }
  24. }
  25. cout<<endl;
  26. cout<<s;
  27. a=-1;
  28. i=0;
  29. do
  30. {
  31. a++;
  32. if(a<=10)
  33. {
  34. i++;
  35. }
  36. sw=sw+t[i][a];
  37.  
  38.  
  39. }while(i<10);
  40.  
  41. cout<<endl<<sw;
  42.  
  43.  
  44.  
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement