#553
PozMinMax
Să se determine indicele maximului şi cel al minimului valorilor elementelor unui vector.
Problema | PozMinMax | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #9933415 | Utilizator | |
Fișier | pozminmax.c | Dimensiune | 744 B |
Data încărcării | 23 Iunie 2018, 01:02 | Scor / rezultat | Eroare de compilare |
pozminmax.c: In function 'main': pozminmax.c:4:5: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] scanf("%d",&dimensiune); ^ pozminmax.c:4:5: warning: incompatible implicit declaration of built-in function 'scanf' [enabled by default] pozminmax.c:10:11: error: redeclaration of 'i' with no linkage for (int i = 1; i < dimensiune; i++) ^ pozminmax.c:2:22: note: previous declaration of 'i' was here int vector[1000],i,dimensiune; ^ pozminmax.c:10:2: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 1; i < dimensiune; i++) ^ pozminmax.c:10:2: note: use option -std=c99 or -std=gnu99 to compile your code pozminmax.c:23:11: error: redefinition of 'i' for (int i = 1; i < dimensiune; i++) ^ pozminmax.c:10:11: note: previous definition of 'i' was here for (int i = 1; i < dimensiune; i++) ^ pozminmax.c:23:2: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 1; i < dimensiune; i++) ^ pozminmax.c:36:11: error: redefinition of 'i' for (int i = 0; i < dimensiune; i++) ^ pozminmax.c:23:11: note: previous definition of 'i' was here for (int i = 1; i < dimensiune; i++) ^ pozminmax.c:36:2: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < dimensiune; i++) ^ pozminmax.c:40:4: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] printf("%d ", i); ^ pozminmax.c:40:4: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default] pozminmax.c:43:11: error: redefinition of 'i' for (int i = 0; i < dimensiune; i++) ^ pozminmax.c:36:11: note: previous definition of 'i' was here for (int i = 0; i < dimensiune; i++) ^ pozminmax.c:43:2: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < dimensiune; i++) ^ pozminmax.c:47:4: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default] printf("%d\n", i); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PozMinMax 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ă.