Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- #include <time.h>
- using namespace std;
- int main(int argc, char *argv[])
- {
- /*
- int a[7][7],i,l,sprz=0,sb1=0;
- for (i=0;i<7;i++)
- {
- for (l=0;l<7;l++)
- {
- a[i][l]=rand()%9+1;
- cout<<a[i][l] <<" ";
- }
- cout<<endl;
- };
- for (i=0;i<7;i++)
- {
- for (l=0;l<7;l++)
- {
- if (i==l)
- {
- sprz+=a[i][l];
- };
- if (i+l==6)
- {
- sprz+=a[i][l];
- }
- if((i==0)||(i==7-1)||(l==0)||(l==7-1))sb1=sb1+a[i][l];
- }
- }
- cout<<"suma na brzegach: "<<sb1<<"."<<endl;
- cout<<"suma przekatnych: "<<sprz<<endl;
- for (i=0;i<7;i++)
- {
- for (l=0;l<7;l++)
- {
- if((i!=0)&&(i!=6)&&(l!=0)&&(i!=l)&&(i!=6-l)&&(l!=6))
- a[i][l]=0;
- };
- };
- for (i=0;i<7;i++)
- {
- for (l=0;l<7;l++)
- {
- cout<<a[i][l] <<" ";
- }
- cout<<endl;
- }
- */
- int a[5][5],i,l,lia=0,lis=0;
- srand(time(NULL));
- for (i=0;i<5;i++)
- {
- for (l=0;l<7;l++)
- {
- a[i][l]=rand()%25+65;
- cout<<char(a[i][l]) <<" ";
- if (a[i][l]==65)
- {
- lia++;}
- if((a[i][l]=='A')||(a[i][l]=='E')||(a[i][l]=='I')||(a[i][l]=='O')||(a[i][l]=='U')||(a[i][l]=='Y'))
- lis++;
- }
- cout<<endl;
- };
- cout<<"ile samoglosek: "<<lis<<endl;
- cout<<"ile a: "<<lia<<endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement