Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <string>
- #include <time.h>
- #include <stdlib.h>
- #include <stdio.h>
- using namespace std;
- int v[91];
- int nr1[5];
- void afisNumere()
- {
- system("clear");
- int k=0;
- for(int i=1;i<=90;i++)
- {
- if(v[i]>0)
- {
- if(i<10)
- cout<<" ";
- cout<<i<<" , ";
- k++;
- }
- if((i+1)%10==0 )
- cout<<endl;
- }
- cout<<endl;
- }
- int main()
- {
- srand (time(NULL));
- while(1)
- {
- int nr = rand() % 90+1;
- if(v[nr]==0)
- {
- cout<<"\n\nNr extras este: "<<nr<<endl;
- printf("\t\t\t\t\t\t\t%d %d %d %d %d\t\t\t\t\t%d",nr1[0],nr1[1],nr1[2],nr1[3],nr1[4],nr);
- nr1[4]=nr1[3];
- nr1[3]=nr1[2];
- nr1[2]=nr1[1];
- nr1[1]=nr1[0];
- nr1[0]=nr;
- cout.flush();
- }
- v[nr]++;
- if(v[nr]==1)
- {
- if (cin.get() == '\n')
- {
- afisNumere();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement