Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main()
- {
- int array[3][5] = {{1,2,3,4,5}, {1,2,3,4,5},{1,2,3,4,5}};
- for(int i = 0;i<3;i++){for(int j=0;j<5;j++){
- cout << array[i][j]; } cout << endl;}
- //=====================================================
- float array2[4][3];
- float count = 0;
- srand(time(0));
- for(int i = 0;i<4;i++){for(int j=0;j<3;j++){ array2[i][j] = rand()%1000/10.0; count=+array2[i][j]; } cout << i+1 << " rindas masiva elementu summa: " << count << endl; count = 0;}
- //=====================================================
- char array3[5][5];
- int count2[5][2]={{0,0},{0,0},{0,0},{0,0},{0,0}};
- int max = 0,max2 = 0;
- for(int i = 0;i<5;i++){for(int j=0;j<5;j++){ do{ count = rand()%48+65;}while(count>90 && count<97);
- if(count<=90)count2[i][0]+=1;else count2[i][1]+=1;
- array3[j][i]= char(count);}
- if(count2[max][0]<count2[i][0]) max = i;
- if(count2[max2][1]<count2[i][1]) max2 = i; }
- cout << "Mazako burtu skaits rinda: " << max+1 << endl;
- cout << "Lielako burtu skaits rinda: " << max2+1 << endl;
- //=====================================================
- int array4[6][10];
- for(int i = 0;i<10;i++){for(int j=0;j<5;j++){ array4[j][i]=rand()%1000+1;
- if(j!=0){if(max<array4[j][i]) max = array4[j][i];} else max = array4[0][i];}
- array4[5][i] = max*=2;}
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement