#2641
Gigel are ca temă la matematică să precizeze valoarea de adevăr a unor expresii de forma nr1 semn nr2 = nr3, unde nr1, nr2 și nr3 sunt numere naturale, iar semn poate fi +, -, x sau : reprezintând adunarea, scăderea, înmulțirea și împărțirea. Ajutați-l pe Gigel să rezolve tema la matematică.
-
| Problema | AF | Operații I/O |
af.in/af.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64333197 | Utilizator | |
| Fișier | af.cpp | Dimensiune | 828 B |
| Data încărcării | 30 Aprilie 2026, 09:51 | Scor/rezultat | Eroare de compilare |
af.cpp:4:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 4 | ofstream fout("af.out") | ^~~~~~~~ af.cpp: In function ‘int main()’: af.cpp:8:10: error: ‘n’ was not declared in this scope 8 | fin>>n; | ^ af.cpp:9:12: error: expected unqualified-id before ‘=’ token 9 | for(int=0;i<n;i++) | ^ af.cpp:9:12: error: expected ‘;’ before ‘=’ token 9 | for(int=0;i<n;i++) | ^ | ; af.cpp:9:12: error: expected primary-expression before ‘=’ token af.cpp:9:15: error: ‘i’ was not declared in this scope 9 | for(int=0;i<n;i++) | ^ af.cpp:9:18: error: expected ‘)’ before ‘;’ token 9 | for(int=0;i<n;i++) | ~ ^ | ) af.cpp:9:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 9 | for(int=0;i<n;i++) | ^~~ af.cpp:9:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 9 | for(int=0;i<n;i++) | ^ af.cpp:9:19: error: ‘i’ was not declared in this scope af.cpp:35:5: error: ‘fout’ was not declared in this scope 35 | fout.close(); | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AF 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ă.