#1
sum
Să se scrie un program care citeşte din fişier două numere întregi şi determină suma lor.
Problema | sum | Operații I/O |
sum.in /sum.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48847714 | Utilizator | |
Fișier | sum.cpp | Dimensiune | 833 B |
Data încărcării | 07 Februarie 2024, 12:16 | Scor / rezultat | Eroare de compilare |
sum.cpp: In function 'void solve()': sum.cpp:12:9: error: 'fra' was not declared in this scope fra[a[i]]=true; ^ sum.cpp:16:9: error: 'frb' was not declared in this scope frb[b[i]]=true; ^ sum.cpp:20:12: error: 'fra' was not declared in this scope if(fra[i] && frb[i])++z; ^ sum.cpp:20:22: error: 'frb' was not declared in this scope if(fra[i] && frb[i])++z; ^ sum.cpp:20:31: error: 'z' was not declared in this scope if(fra[i] && frb[i])++z; ^ sum.cpp:21:24: error: 'x' was not declared in this scope else if(fra[i])x++; ^ sum.cpp:22:24: error: 'y' was not declared in this scope else if(frb[i])y++; ^ sum.cpp:26:13: error: 'ok' was not declared in this scope ok=false; ^ sum.cpp:29:8: error: 'ok' was not declared in this scope if(ok) ^ sum.cpp:31:16: error: 'z' was not declared in this scope if(k/2-z<x)cout<<"no"; ^ sum.cpp:31:18: error: 'x' was not declared in this scope if(k/2-z<x)cout<<"no"; ^ sum.cpp:32:23: error: 'y' was not declared in this scope else if(k/2-z<y)cout<<"no"; ^ sum.cpp: In function 'int main()': sum.cpp:37:31: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("nr.in","r",stdin); ^ sum.cpp:38:33: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("nr.out","w",stdout); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sum face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.