Cod sursa(job #667839)
Utilizator | Data | 23 ianuarie 2012 20:06:58 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
long p,x,y,n;
int main(){
f>>p;
if(p<0){
cout<<"val incorect";
}
else{
y=p;
y=y/6;
y=y*5;
n=p*5-y;
if(p==0){
n=1;
}
g<<n;
}
return 0;
}