Cod sursa(job #529656)
Utilizator | Data | 5 februarie 2011 17:53:05 | |
---|---|---|---|
Problema | A+B | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <stdio.h>
int s;
FILE * f;
int main(){
int x;
if (!f)
f = fopen("adunare.in", "r");
if ( fscanf (f, "%d", &x) > 0 ){
s += x;
main();
}
else{
freopen("adunare.out", "w", stdout);
printf ( "%d\n", s );
}
return 0;
}