Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<stdlib.h>
- #include<conio.h>
- using namespace std;
- void input()
- {
- cout<<" Parvo teglene"<<endl<<endl;
- int tirash[101][6];
- for (int i=1;i<101;i++){
- for (int j=1;j<7;j++){
- tirash[i][j]=rand()%49+1;
- //cout<< "Tiraj: "<<i<<" Teglene: "<<j<<"Chislo: "<<tirash[i][j]<<endl;
- }
- }
- for (int i=1;i<101;i++){
- cout<<"Tiraj:"<<i<<": "<<tirash[i][1]<<","<<tirash[i][2]<<","<<tirash[i][3]<<","<<tirash[i][4]<<","<<tirash[i][5]<<","<<tirash[i][6];
- if(i%2) { cout<<" "; } else { cout<<endl; }
- }
- }
- void input2()
- {
- cout<<" Vtoro teglene"<<endl<<endl;
- int tirash2[101][6];
- for (int i2=1;i2<101;i2++){
- for (int j2=1;j2<7;j2++){
- tirash2[i2][j2]=rand()%49+1;
- //cout<< "Tiraj: "<<i<<" Teglene: "<<j<<"Chislo: "<<tirash[i][j]<<endl;
- }
- }
- for (int i2=1;i2<101;i2++){
- cout<<"Tiraj:"<<i2<<": "<<tirash2[i2][1]<<","<<tirash2[i2][2]<<","<<tirash2[i2][3]<<","<<tirash2[i2][4]<<","<<tirash2[i2][5]<<","<<tirash2[i2][6];
- if(i2%2) { cout<<" "; } else { cout<<endl; }
- }
- }
- void input3()
- {
- cout<<" Treto teglene"<<endl<<endl;
- int tirash3[101][6];
- for (int i3=1;i3<101;i3++){
- for (int j3=1;j3<7;j3++){
- tirash3[i3][j3]=rand()%49+1;
- //cout<< "Tiraj: "<<i<<" Teglene: "<<j<<"Chislo: "<<tirash[i][j]<<endl;
- }
- }
- for (int i3=1;i3<101;i3++){
- cout<<"Tiraj:"<<i3<<": "<<tirash3[i3][1]<<","<<tirash3[i3][2]<<","<<tirash3[i3][3]<<","<<tirash3[i3][4]<<","<<tirash3[i3][5]<<","<<tirash3[i3][6];
- if(i3%2) { cout<<" "; } else { cout<<endl; }
- }
- }
- int main()
- {
- int nomer;
- while(1)
- {
- cout<<"Deistvie za izpulnqvane: 1,2,3,4 : ";
- cout<<"\n 1.Generirane na izteglenite chisla za vseki tiraj ot 1 teglene";
- cout<<"\n 2.Generirane na izteglenite chisla za vseki tiraj ot 2 teglene";
- cout<<"\n 3.Generirane na izteglenite chisla za vseki tiraj ot 3 teglene"<<endl;
- cout<<" 4. Izhod ot programata"<<endl;
- cout<<endl;
- do
- {
- cin>>nomer;
- }while(nomer<1&&nomer>4);
- switch (nomer)
- {
- case 1: input(); break;
- case 2: input2(); break;
- case 3: input3(); break;
- case 4: return 0; break;
- default : cout<<"Nevaliden vhod!"<<endl;
- break;
- }
- }
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement