Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main () {
- int wybor, losa[5], losr[5], cyfr[6049][6], j, i;
- string data, lp;
- srand(time(0));
- cout<<"+-------------MENU---------------+"<<endl;
- cout<<"| 1. Losowanie Duzy Lotek (6/49) |"<<endl;
- cout<<"|--------------------------------|"<<endl;
- cout<<"| 2. Reczne wybranie liczb |"<<endl;
- cout<<"|--------------------------------|"<<endl;
- cout<<"| 3. Sprawdzenie wynikow |"<<endl;
- cout<<"|--------------------------------|"<<endl;
- cout<<"| 4. Wyjscie |"<<endl;
- cout<<"+--------------------------------+"<<endl;
- cout<<endl<<"Wybierz dzialanie: ";
- cin>>wybor;
- switch(wybor) {
- case 1:
- for(i=0;i<6;i++) {
- losa[i] = rand()%49+1;
- cout<<losa[i]<<" ";
- }
- break;
- case 2:
- cout<<"Wpisz recznie 6 liczb (od 1 do 49): "<<endl;
- for (int i=0;i<6;i++) {
- cout<<i+1<<". liczba: ";
- cin>>losr[i];
- }
- break;
- case 3:
- ifstream dl("dl.txt");
- while (!dl.eof()) {
- dl>>lp;
- dl>>data;
- for (int j=0;j<6;j++)
- dl>>cyfr[i][j];
- cout<<lp<<"\t"<<data<<"\t";
- for(int k=0;k<6;k++)
- cout<<cyfr[i][k]<<"\t";
- cout<<endl;
- i++;
- }
- break;
- }
- }
Add Comment
Please, Sign In to add comment