#88
Palindrom
Să se verifice dacă un cuvânt dat este palindrom.
Problema | Palindrom | Operații I/O |
![]() palindrom.in /palindrom.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51524830 | Utilizator | |
Fișier | palindrom.c | Dimensiune | 735 B |
Data încărcării | 04 Iulie 2024, 16:16 | Scor / rezultat | 0 puncte |
palindrom.c:4:6: warning: return type of 'main' is not 'int' [-Wmain] void main() ^ palindrom.c: In function 'main': palindrom.c:9:2: warning: passing argument 1 of 'fgets' from incompatible pointer type [enabled by default] printf("Citeste numele fisierului text "); fgets(stdin,nume, 20); ^ In file included from /usr/include/stdio.h:937:0, from palindrom.c:2: /usr/include/i386-linux-gnu/bits/stdio2.h:253:1: note: expected 'char * restrict' but argument is of type 'struct _IO_FILE *' fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ^ palindrom.c:9:2: warning: passing argument 2 of 'fgets' makes integer from pointer without a cast [enabled by default] printf("Citeste numele fisierului text "); fgets(stdin,nume, 20); ^ In file included from /usr/include/stdio.h:937:0, from palindrom.c:2: /usr/include/i386-linux-gnu/bits/stdio2.h:253:1: note: expected 'int' but argument is of type 'char *' fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ^ palindrom.c:9:2: warning: passing argument 3 of 'fgets' makes pointer from integer without a cast [enabled by default] printf("Citeste numele fisierului text "); fgets(stdin,nume, 20); ^ In file included from /usr/include/stdio.h:937:0, from palindrom.c:2: /usr/include/i386-linux-gnu/bits/stdio2.h:253:1: note: expected 'struct FILE * restrict' but argument is of type 'int' fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ^ palindrom.c:15:3: warning: passing argument 1 of 'fgets' from incompatible pointer type [enabled by default] printf("Citeste numele fisierului rezultat ");fgets(stdin,num, 20); ^ In file included from /usr/include/stdio.h:937:0, from palindrom.c:2: /usr/include/i386-linux-gnu/bits/stdio2.h:253:1: note: expected 'char * restrict' but argument is of type 'struct _IO_FILE *' fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ^ palindrom.c:15:3: warning: passing argument 2 of 'fgets' makes integer from pointer without a cast [enabled by default] printf("Citeste numele fisierului rezultat ");fgets(stdin,num, 20); ^ In file included from /usr/include/stdio.h:937:0, from palindrom.c:2: /usr/include/i386-linux-gnu/bits/stdio2.h:253:1: note: expected 'int' but argument is of type 'char *' fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ^ palindrom.c:15:3: warning: passing argument 3 of 'fgets' makes pointer from integer without a cast [enabled by default] printf("Citeste numele fisierului rezultat ");fgets(stdin,num, 20); ^ In file included from /usr/include/stdio.h:937:0, from palindrom.c:2: /usr/include/i386-linux-gnu/bits/stdio2.h:253:1: note: expected 'struct FILE * restrict' but argument is of type 'int' fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ^ palindrom.c:19:4: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'char (*)[20]' [-Wformat=] fscanf(f, "%s", &sir); ^ palindrom.c:21:4: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] j = strlen(sir) - 1; ^ palindrom.c:21:8: warning: incompatible implicit declaration of built-in function 'strlen' [enabled by default] j = strlen(sir) - 1; ^ palindrom.c:9:50: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result] printf("Citeste numele fisierului text "); fgets(stdin,nume, 20); ^ palindrom.c:15:54: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result] printf("Citeste numele fisierului rezultat ");fgets(stdin,num, 20); ^ palindrom.c:17:9: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(f, "%d", &n); ^ palindrom.c:19:10: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(f, "%s", &sir); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Raspuns gresit. | 10 | 0 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 50 | 0 | ||
3 | 0 secunde | Raspuns gresit. | 40 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Palindrom 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ă.