#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 | #64696759 | Utilizator | |
| Fișier | prodmax1.c | Dimensiune | 839 B |
| Data încărcării | 24 Mai 2026, 13:58 | Scor/rezultat | 0 puncte |
prodmax1.c: In function ‘main’: prodmax1.c:7:13: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=] 7 | scanf("%d",&n); | ~^ ~~ | | | | | long int * | int * | %ld prodmax1.c:9:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=] 9 | scanf("%d",&x); | ~^ ~~ | | | | | long int * | int * | %ld prodmax1.c:28:19: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 28 | printf("%d",max1*min1); | ~^ ~~~~~~~~~ | | | | int long int | %ld prodmax1.c:30:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 30 | printf("%d",max1*max2); | ~^ ~~~~~~~~~ | | | | int long int | %ld prodmax1.c:32:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 32 | printf("%d",min1*min2); | ~^ ~~~~~~~~~ | | | | int long int | %ld prodmax1.c:6:43: warning: variable ‘cit4’ set but not used [-Wunused-but-set-variable] 6 | bool cit1=false,cit2=false,cit3=false,cit4=false; | ^~~~ prodmax1.c:6:32: warning: variable ‘cit3’ set but not used [-Wunused-but-set-variable] 6 | bool cit1=false,cit2=false,cit3=false,cit4=false; | ^~~~ prodmax1.c:7:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d",&n); | ^~~~~~~~~~~~~~ prodmax1.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d",&x); | ^~~~~~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0.008 secunde | Raspuns gresit. | 10 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 6 | 0.008 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.009 secunde | Raspuns gresit. | 10 | 0 | ||
| 8 | 0.009 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 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ă.