#129
Sortare
Să se scrie un program care ordonează descrescător elementele unui vector.
Problema | Sortare | Operații I/O |
sortare.in /sortare.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49144528 | Utilizator | |
Fișier | sortare.c | Dimensiune | 658 B |
Data încărcării | 16 Februarie 2024, 19:13 | Scor / rezultat | Eroare de compilare |
sortare.c: In function 'main': sortare.c:9:5: warning: passing argument 1 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%i", &n); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from sortare.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'char *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ sortare.c:9:5: warning: passing argument 2 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%i", &n); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from sortare.c:1: /usr/include/stdio.h:443:12: note: expected 'const char * restrict' but argument is of type 'int *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ sortare.c:9:5: warning: format not a string literal and no format arguments [-Wformat-security] fscanf("%i", &n); ^ sortare.c:11:9: warning: passing argument 1 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%i", &v[i]); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from sortare.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'char *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ sortare.c:11:9: warning: passing argument 2 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%i", &v[i]); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from sortare.c:1: /usr/include/stdio.h:443:12: note: expected 'const char * restrict' but argument is of type 'int *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ sortare.c:11:9: warning: format not a string literal and no format arguments [-Wformat-security] fscanf("%i", &v[i]); ^ sortare.c:17:33: error: expected ')' before '{' token if (v[i] > v[i + 1] { ^ sortare.c:25:5: error: expected expression before '}' token } while (!sortat); ^ sortare.c:7:28: warning: unused variable 'temp' [-Wunused-variable] int n, v[100], sortat, temp; ^ sortare.c:9:11: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf("%i", &n); ^ sortare.c:11:15: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf("%i", &v[i]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Sortare 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ă.