Advertisement
Guest User

Untitled

a guest
Dec 16th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.44 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdlib.h>
  3. #include<conio.h>
  4. using namespace std;
  5. void input()
  6. {
  7.  
  8.     cout<<"                      Parvo teglene"<<endl<<endl;
  9. int tirash[101][6];
  10.     for (int i=1;i<101;i++){
  11.                 for (int j=1;j<7;j++){
  12.  
  13.                 tirash[i][j]=rand()%49+1;
  14. //cout<< "Tiraj: "<<i<<" Teglene: "<<j<<"Chislo: "<<tirash[i][j]<<endl;
  15.         }
  16.         }
  17.         for (int i=1;i<101;i++){
  18.                 cout<<"Tiraj:"<<i<<": "<<tirash[i][1]<<","<<tirash[i][2]<<","<<tirash[i][3]<<","<<tirash[i][4]<<","<<tirash[i][5]<<","<<tirash[i][6];
  19.                 if(i%2) { cout<<"      "; } else { cout<<endl; }
  20.         }
  21. }
  22. void input2()
  23. {
  24.  
  25.  
  26.         cout<<"                      Vtoro teglene"<<endl<<endl;
  27. int tirash2[101][6];
  28.     for (int i2=1;i2<101;i2++){
  29.                 for (int j2=1;j2<7;j2++){
  30.  
  31.                 tirash2[i2][j2]=rand()%49+1;
  32. //cout<< "Tiraj: "<<i<<" Teglene: "<<j<<"Chislo: "<<tirash[i][j]<<endl;
  33.         }
  34.         }
  35.  
  36.         for (int i2=1;i2<101;i2++){
  37.                 cout<<"Tiraj:"<<i2<<": "<<tirash2[i2][1]<<","<<tirash2[i2][2]<<","<<tirash2[i2][3]<<","<<tirash2[i2][4]<<","<<tirash2[i2][5]<<","<<tirash2[i2][6];
  38.                 if(i2%2) { cout<<"      "; } else { cout<<endl; }
  39.         }
  40. }
  41. void input3()
  42. {
  43.  
  44.  
  45. cout<<"                      Treto teglene"<<endl<<endl;
  46. int tirash3[101][6];
  47.     for (int i3=1;i3<101;i3++){
  48.                 for (int j3=1;j3<7;j3++){
  49.  
  50.                 tirash3[i3][j3]=rand()%49+1;
  51. //cout<< "Tiraj: "<<i<<" Teglene: "<<j<<"Chislo: "<<tirash[i][j]<<endl;
  52.         }
  53.         }
  54.  
  55.         for (int i3=1;i3<101;i3++){
  56.                 cout<<"Tiraj:"<<i3<<": "<<tirash3[i3][1]<<","<<tirash3[i3][2]<<","<<tirash3[i3][3]<<","<<tirash3[i3][4]<<","<<tirash3[i3][5]<<","<<tirash3[i3][6];
  57.                 if(i3%2) { cout<<"      "; } else { cout<<endl; }
  58.         }
  59. }
  60. int main()
  61. {
  62. int nomer;
  63. while(1)
  64. {
  65.     cout<<"Deistvie za izpulnqvane: 1,2,3,4 : ";
  66. cout<<"\n 1.Generirane na izteglenite chisla za vseki tiraj ot 1 teglene";
  67. cout<<"\n 2.Generirane na izteglenite chisla za vseki tiraj ot 2 teglene";
  68. cout<<"\n 3.Generirane na izteglenite chisla za vseki tiraj ot 3 teglene"<<endl;
  69. cout<<" 4. Izhod ot programata"<<endl;
  70. cout<<endl;
  71. do
  72. {
  73. cin>>nomer;
  74. }while(nomer<1&&nomer>4);
  75. switch (nomer)
  76. {
  77. case 1: input(); break;
  78. case 2: input2(); break;
  79. case 3: input3(); break;
  80. case 4: return 0; break;
  81. default : cout<<"Nevaliden vhod!"<<endl;
  82. break;
  83. }
  84. }
  85. _getch();
  86. return 0;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement