#2271
Se dă un șir cu n numere întregi. Determinați cel mai mare număr care poate fi scris ca produs de două elemente ale șirului.
| Problema | ProdMax1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64373083 | Utilizator | |
| Fișier | prodmax1.cpp | Dimensiune | 452 B |
| Data încărcării | 04 Mai 2026, 10:07 | Scor/rezultat | Eroare de compilare |
prodmax1.cpp:4:11: error: expected ‘)’ before ‘{’ token 4 | int main() | ^ | ) 5 | { | ~ prodmax1.cpp:3:13: note: to match this ‘(’ 3 | ifstream fin( | ^ prodmax1.cpp:5:1: error: return type ‘std::ifstream’ {aka ‘class std::basic_ifstream<char>’} is incomplete 5 | { | ^ prodmax1.cpp: In function ‘void fin(int (*)())’: prodmax1.cpp:7:13: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 7 | int main() | ^~ prodmax1.cpp:7:13: note: remove parentheses to default-initialize a variable 7 | int main() | ^~ | -- prodmax1.cpp:7:13: note: or replace parentheses with braces to value-initialize a variable prodmax1.cpp:8:5: error: a function-definition is not allowed here before ‘{’ token 8 | { | ^ prodmax1.cpp:6:9: warning: unused variable ‘a’ [-Wunused-variable] 6 | int a[101][101],n,i,j,maxi,suma; | ^ prodmax1.cpp:6:21: warning: unused variable ‘n’ [-Wunused-variable] 6 | int a[101][101],n,i,j,maxi,suma; | ^ prodmax1.cpp:6:23: warning: unused variable ‘i’ [-Wunused-variable] 6 | int a[101][101],n,i,j,maxi,suma; | ^ prodmax1.cpp:6:25: warning: unused variable ‘j’ [-Wunused-variable] 6 | int a[101][101],n,i,j,maxi,suma; | ^ prodmax1.cpp: At global scope: prodmax1.cpp:18:9: error: ‘fout’ does not name a type 18 | fout<<suma; | ^~~~ prodmax1.cpp:19:5: error: ‘fin’ does not name a type 19 | fin.close(); | ^~~ prodmax1.cpp:20:5: error: ‘fout’ does not name a type 20 | fout.close(); | ^~~~ prodmax1.cpp:21:5: error: expected unqualified-id before ‘return’ 21 | return 0;} | ^~~~~~ prodmax1.cpp:21:14: error: expected declaration before ‘}’ token 21 | return 0;} | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ProdMax1 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ă.