Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <time.h>
  4. #include <cstdlib>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. srand( time( NULL ) );
  11.  
  12. int w=5;
  13. int k=5;
  14. int t[w][k];
  15. for(int i=0;i<w;i++)
  16. {
  17. int a = 0;
  18. for(int j=0;j<k;j++)
  19. {
  20. t[i][j]=rand()%100;
  21. cout<<setw(5)<<t[i][j]<<" ";
  22. if(t[i][j]%2 != 0) a++;
  23. }
  24. cout << "Liczba nieparzystych: " << a << endl;
  25. }
  26.  
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement