Cod sursa(job #138979)
Utilizator | Data | 19 februarie 2008 16:20:38 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<fstream.h>
#include<iostream.h>
#include<stdio.h>
int main()
{int i,j,m=1,n,n0=0;
ifstream in("fact.in");
ofstream out("fact.out");
in>>n;
in.close();
m=1;
while(n0<n)
{m++;
for(i=1;i<=m;i++)
{if(i%10==2 && (i+3)%10==5) n0++;
if(i%10==0) n0++;
}
out<<m;
out.close();
return 0;
}