Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <conio.h>
- #include <time.h>
- #include <cstdlib>
- #include <fstream>
- using namespace std;
- string num[10]={"0","1","2","3","4","5","6","7","8","9"};
- string fnum;
- int ran, ran2, ran3, ran4;
- int main()
- {
- fstream nfile;
- nfile.open("Numbers.txt", ios::out);
- srand(time(NULL));
- for(int i=0;i<=100;i++)
- {
- ran =rand()%10;
- ran2=ran;
- ran =rand()%10;
- ran3=ran;
- ran =rand()%10;
- ran4=ran;
- ran =rand()%10;
- fnum=num[ran]+num[ran2]+num[ran3]+num[ran4];
- cout<<fnum<<endl;
- nfile<<fnum<<endl;
- Sleep(1000);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement