vertc

23-01

Jan 23rd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstdlib>
  4. #include <ctime>
  5.  
  6. using namespace std;
  7.  
  8. int main () {
  9.     int wybor, losa[5], losr[5], cyfr[6049][6], j, i;
  10.     string data, lp;
  11.     srand(time(0));
  12.     cout<<"+-------------MENU---------------+"<<endl;
  13.     cout<<"| 1. Losowanie Duzy Lotek (6/49) |"<<endl;
  14.     cout<<"|--------------------------------|"<<endl;
  15.     cout<<"| 2. Reczne wybranie liczb       |"<<endl;
  16.     cout<<"|--------------------------------|"<<endl;
  17.     cout<<"| 3. Sprawdzenie wynikow         |"<<endl;
  18.     cout<<"|--------------------------------|"<<endl;
  19.     cout<<"| 4. Wyjscie                     |"<<endl;
  20.     cout<<"+--------------------------------+"<<endl;
  21.     cout<<endl<<"Wybierz dzialanie: ";
  22.         cin>>wybor;
  23.         switch(wybor) {
  24.         case 1:
  25.             for(i=0;i<6;i++) {
  26.                 losa[i] = rand()%49+1;
  27.                 cout<<losa[i]<<" ";
  28.             }
  29.             break;
  30.         case 2:
  31.             cout<<"Wpisz recznie 6 liczb (od 1 do 49): "<<endl;
  32.             for (int i=0;i<6;i++) {
  33.                 cout<<i+1<<". liczba: ";
  34.                 cin>>losr[i];
  35.             }
  36.             break;
  37.         case 3:
  38.             ifstream dl("dl.txt");
  39.             while (!dl.eof()) {
  40.                 dl>>lp;
  41.                 dl>>data;
  42.                 for (int j=0;j<6;j++)
  43.                     dl>>cyfr[i][j];
  44.                 cout<<lp<<"\t"<<data<<"\t";
  45.                 for(int k=0;k<6;k++)
  46.                     cout<<cyfr[i][k]<<"\t";
  47.                 cout<<endl;
  48.                 i++;
  49.             }
  50.             break;
  51.         }
  52. }
Add Comment
Please, Sign In to add comment