#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 | #49076159 | Utilizator | |
Fișier | prodmax1.cpp | Dimensiune | 817 B |
Data încărcării | 14 Februarie 2024, 15:16 | Scor / rezultat | Eroare de compilare |
prodmax1.cpp: In function 'int main()': prodmax1.cpp:9:10: error: 'x' was not declared in this scope cin>>x>>y; ^ prodmax1.cpp:9:13: error: 'y' was not declared in this scope cin>>x>>y; ^ prodmax1.cpp:12:9: error: 'min1' was not declared in this scope min1=x; ^ prodmax1.cpp:13:9: error: 'min2' was not declared in this scope min2=y; ^ prodmax1.cpp:14:9: error: 'max1' was not declared in this scope max1=y; ^ prodmax1.cpp:15:9: error: 'max2' was not declared in this scope max2=x; ^ prodmax1.cpp:19:9: error: 'min1' was not declared in this scope min1=y; ^ prodmax1.cpp:20:9: error: 'min2' was not declared in this scope min2=x; ^ prodmax1.cpp:21:9: error: 'max1' was not declared in this scope max1=x; ^ prodmax1.cpp:22:9: error: 'max2' was not declared in this scope max2=y; ^ prodmax1.cpp:24:9: error: 'i' was not declared in this scope for(i=3;i<=n;i++) ^ prodmax1.cpp:27:14: error: 'min1' was not declared in this scope if(x<min1) ^ prodmax1.cpp:29:13: error: 'min2' was not declared in this scope min2=min1; ^ prodmax1.cpp:33:18: error: 'min2' was not declared in this scope if(x>min2) ^ prodmax1.cpp:35:14: error: 'max1' was not declared in this scope if(x>max1) ^ prodmax1.cpp:37:13: error: 'max2' was not declared in this scope max2=max1; ^ prodmax1.cpp:40:19: error: 'max2' was not declared in this scope else if(x>max2) ^ prodmax1.cpp:44:29: error: 'min1' was not declared in this scope long long m1=(long long)min1*min2; ^ prodmax1.cpp:44:34: error: 'min2' was not declared in this scope long long m1=(long long)min1*min2; ^ prodmax1.cpp:45:29: error: 'max1' was not declared in this scope long long m2=(long long)max1*max2; ^ prodmax1.cpp:45:34: error: 'max2' was not declared in this scope long long m2=(long long)max1*max2; ^ prodmax1.cpp:46:8: error: expected '(' before 'm1' if m1>m2 ^ prodmax1.cpp:48:5: error: 'else' without a previous 'if' else ^ prodmax1.cpp:7:12: warning: unused variable 'ora_inceput' [-Wunused-variable] int n, ora_inceput[100], ora_sfrasit[100]; ^ prodmax1.cpp:7:30: warning: unused variable 'ora_sfrasit' [-Wunused-variable] int n, ora_inceput[100], ora_sfrasit[100]; ^ prodmax1.cpp:44:15: warning: unused variable 'm1' [-Wunused-variable] long long m1=(long long)min1*min2; ^
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ă.