#282
PozMax
Se dă un şir cu n
elemente, numere reale, numerotate de la 1
la n
. Determinaţi numărul de ordine al primei şi al ultimei apariţii a valorii maxime din şir.
Problema | PozMax | Operații I/O |
pozmax.in /pozmax.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 32 MB
/
Stivă 8 MB
|
Id soluție | #51728767 | Utilizator | |
Fișier | pozmax.c | Dimensiune | 770 B |
Data încărcării | 09 August 2024, 17:16 | Scor / rezultat | Eroare de compilare |
pozmax.c: In function 'main': pozmax.c:5:5: error: unknown type name 'FILE' FILE *fin = fopen("pozmax.in", "r"); ^ pozmax.c:5:5: warning: implicit declaration of function 'fopen' [-Wimplicit-function-declaration] pozmax.c:5:17: warning: initialization makes pointer from integer without a cast [enabled by default] FILE *fin = fopen("pozmax.in", "r"); ^ pozmax.c:6:16: error: 'NULL' undeclared (first use in this function) if (fin == NULL) ^ pozmax.c:6:16: note: each undeclared identifier is reported only once for each function it appears in pozmax.c:8:5: warning: implicit declaration of function 'fscanf' [-Wimplicit-function-declaration] fscanf(fin,"%d", &n); ^ pozmax.c:8:5: warning: incompatible implicit declaration of built-in function 'fscanf' [enabled by default] pozmax.c:17:5: warning: implicit declaration of function 'fclose' [-Wimplicit-function-declaration] fclose(fin); ^ pozmax.c:18:5: error: unknown type name 'FILE' FILE* fout = fopen("pozmax.out", "w"); ^ pozmax.c:18:18: warning: initialization makes pointer from integer without a cast [enabled by default] FILE* fout = fopen("pozmax.out", "w"); ^ pozmax.c:34:5: warning: implicit declaration of function 'fprintf' [-Wimplicit-function-declaration] fprintf(fout,"%d\n", firstIndex + 1); ^ pozmax.c:34:5: warning: incompatible implicit declaration of built-in function 'fprintf' [enabled by default]
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PozMax 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ă.