Cod sursa(job #883768)
| Utilizator | Data | 20 februarie 2013 12:50:29 | |
|---|---|---|---|
| Problema | Perle | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
#include <ctime>
#include <cstdlib>
using namespace std;
ifstream cin("perle.in");
ofstream cout("perle.out");
int n;
int main()
{
cin>>n;
srand((unsigned)time(0));
int random_integer;
int lowest=0, highest=1;
int range=(highest-lowest)+1;
for(int index=0; index<n; index++){
random_integer = lowest+int(range*rand()/(RAND_MAX + 1.0));
cout << random_integer << "\n";
}
return 0;
}
