#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 | #64696730 | Utilizator | |
| Fișier | prodmax1.c | Dimensiune | 809 B |
| Data încărcării | 24 Mai 2026, 13:55 | Scor/rezultat | Eroare de compilare |
prodmax1.c: In function ‘main’: prodmax1.c:5:5: error: unknown type name ‘bool’ 5 | bool cit1=false,cit2=false,cit3=false,cit4=false; | ^~~~ prodmax1.c:3:1: note: ‘bool’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’? 2 | #include <stdlib.h> +++ |+#include <stdbool.h> 3 | int main(){ prodmax1.c:5:15: error: ‘false’ undeclared (first use in this function) 5 | bool cit1=false,cit2=false,cit3=false,cit4=false; | ^~~~~ prodmax1.c:5:15: note: ‘false’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’? prodmax1.c:5:15: note: each undeclared identifier is reported only once for each function it appears in prodmax1.c:10:18: error: ‘true’ undeclared (first use in this function) 10 | cit1=true; | ^~~~ prodmax1.c:10:18: note: ‘true’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’? prodmax1.c:5:43: warning: variable ‘cit4’ set but not used [-Wunused-but-set-variable] 5 | bool cit1=false,cit2=false,cit3=false,cit4=false; | ^~~~ prodmax1.c:5:32: warning: variable ‘cit3’ set but not used [-Wunused-but-set-variable] 5 | bool cit1=false,cit2=false,cit3=false,cit4=false; | ^~~~ prodmax1.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&n); | ^~~~~~~~~~~~~~ prodmax1.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d",&x); | ^~~~~~~~~~~~~~
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ă.