Borderou de evaluare (job #1715065)

Utilizator andreicoman299Coman Andrei andreicoman299 Data 9 iunie 2016 22:19:51
Problema Suma2 Status done
Runda Arhiva de probleme Compilator cpp | Vezi sursa
Scor 100

Raport evaluator

Compilare: user.cpp: In function ‘int main()’: user.cpp:2:156: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] int max(int a, int b){return a > b ? a : b;}int d[2][2];int main(){int n;FILE*fi,*fo;fi=fopen("suma2.in","r");fo=fopen("suma2.out","w");fscanf(fi,"%d", &n);for(int i=1;i<=n;i++){int x;fscanf(fi,"%d", &x);d[1][0]=max(d[0][0], d[0][1]);d[1][1]=max(x+d[0][0], x);d[0][0]=d[1][0];d[0][1]=d[1][1];}fprintf(fo,"%d", max(d[0][0], d[0][1]));fclose(fi);fclose(fo);return 0;} ^ user.cpp:2:204: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] int max(int a, int b){return a > b ? a : b;}int d[2][2];int main(){int n;FILE*fi,*fo;fi=fopen("suma2.in","r");fo=fopen("suma2.out","w");fscanf(fi,"%d", &n);for(int i=1;i<=n;i++){int x;fscanf(fi,"%d", &x);d[1][0]=max(d[0][0], d[0][1]);d[1][1]=max(x+d[0][0], x);d[0][0]=d[1][0];d[0][1]=d[1][1];}fprintf(fo,"%d", max(d[0][0], d[0][1]));fclose(fi);fclose(fo);return 0;} ^
Test Timp executie Memorie folosita Mesaj Punctaj/test
10ms268kbOK10
20ms260kbOK10
30ms268kbOK10
40ms260kbOK10
54ms260kbOK10
64ms260kbOK10
78ms264kbOK10
820ms256kbOK10
936ms268kbOK10
1048ms264kbOK10
Punctaj total100

Ceva nu functioneaza?