Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <time.h>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- srand( time( NULL ) );
- int w=5;
- int k=5;
- int t[w][k];
- for(int i=0;i<w;i++)
- {
- int a = 0;
- for(int j=0;j<k;j++)
- {
- t[i][j]=rand()%100;
- cout<<setw(5)<<t[i][j]<<" ";
- if(t[i][j]%2 != 0) a++;
- }
- cout << "Liczba nieparzystych: " << a << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement