#2271
ProdMax1
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 | #48154237 | Utilizator | |
Fișier | prodmax1.cpp | Dimensiune | 1.11 KB |
Data încărcării | 17 Ianuarie 2024, 09:13 | Scor / rezultat | Eroare de compilare |
prodmax1.cpp: In function 'void rezolvare1()': prodmax1.cpp:13:14: error: 'INT_MIN' was not declared in this scope int max1=INT_MIN, max2=INT_MIN, min1=INT_MAX, min2=INT_MAX,P=1; ^ prodmax1.cpp:19:17: error: 'max2' was not declared in this scope max2=max1; ^ prodmax1.cpp:22:26: error: 'max2' was not declared in this scope else if(a[i]>max2) ^ prodmax1.cpp:24:21: error: 'min1' was not declared in this scope if(a[i]<min1) ^ prodmax1.cpp:26:17: error: 'min2' was not declared in this scope min2=min1; ^ prodmax1.cpp:29:26: error: 'min2' was not declared in this scope else if(a[i]>min2) ^ prodmax1.cpp:31:17: error: 'min2' was not declared in this scope if(min2==INT_MAX) ^ prodmax1.cpp:31:23: error: 'INT_MAX' was not declared in this scope if(min2==INT_MAX) ^ prodmax1.cpp:32:17: error: 'P' was not declared in this scope P=max1*max2; ^ prodmax1.cpp:32:24: error: 'max2' was not declared in this scope P=max1*max2; ^ prodmax1.cpp:33:16: error: 'max2' was not declared in this scope if(max2==INT_MIN) ^ prodmax1.cpp:34:17: error: 'P' was not declared in this scope P=min1*min2; ^ prodmax1.cpp:34:19: error: 'min1' was not declared in this scope P=min1*min2; ^ prodmax1.cpp:34:24: error: 'min2' was not declared in this scope P=min1*min2; ^ prodmax1.cpp:35:16: error: 'max2' was not declared in this scope if(max2==INT_MIN && min2==INT_MAX) ^ prodmax1.cpp:35:33: error: 'min2' was not declared in this scope if(max2==INT_MIN && min2==INT_MAX) ^ prodmax1.cpp:35:39: error: 'INT_MAX' was not declared in this scope if(max2==INT_MIN && min2==INT_MAX) ^ prodmax1.cpp:36:17: error: 'P' was not declared in this scope P=max1*min1; ^ prodmax1.cpp:36:24: error: 'min1' was not declared in this scope P=max1*min1; ^ prodmax1.cpp:39:26: error: 'max2' was not declared in this scope cout<<max1<<" "<<max2<<endl; ^ prodmax1.cpp:40:15: error: 'min1' was not declared in this scope cout<<min1<<" "<<min2<<endl; ^ prodmax1.cpp:40:26: error: 'min2' was not declared in this scope cout<<min1<<" "<<min2<<endl; ^ prodmax1.cpp:42:13: error: 'P' was not declared in this scope P=max1*max2; ^ prodmax1.cpp:44:13: error: 'P' was not declared in this scope P=min1*min2; ^ prodmax1.cpp:45:15: error: 'P' was not declared in this scope cout<<P; ^
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ă.