#188
InlocuireCuvant
Se dau două cuvinte şi o propoziţie. Să se înlocuiască în propoziţie fiecare apariţie a primului cuvânt cu al doilea.
Problema | InlocuireCuvant | Operații I/O |
inlocuirecuvant.in /inlocuirecuvant.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #27539630 | Utilizator | |
Fișier | inlocuirecuvant.c | Dimensiune | 394 B |
Data încărcării | 26 Ianuarie 2021, 15:46 | Scor / rezultat | 0 puncte |
inlocuirecuvant.c: In function 'main': inlocuirecuvant.c:7:5: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int *' [-Wformat=] scanf("%s%s ", a, b); ^ inlocuirecuvant.c:7:5: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int *' [-Wformat=] inlocuirecuvant.c:8:5: warning: passing argument 1 of 'fgets' from incompatible pointer type [enabled by default] fgets(s, 102, stdin); ^ In file included from /usr/include/stdio.h:937:0, from inlocuirecuvant.c:1: /usr/include/i386-linux-gnu/bits/stdio2.h:253:1: note: expected 'char * __restrict__' but argument is of type 'int *' fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ^ inlocuirecuvant.c:10:5: warning: passing argument 1 of 'strtok' from incompatible pointer type [enabled by default] char* w = strtok(s, sep); ^ In file included from inlocuirecuvant.c:2:0: /usr/include/string.h:348:14: note: expected 'char * __restrict__' but argument is of type 'int *' extern char *strtok (char *__restrict __s, const char *__restrict __delim) ^ inlocuirecuvant.c:12:9: warning: passing argument 1 of '__builtin_strlen' from incompatible pointer type [enabled by default] if (strcmp(w, a) == 0) { ^ inlocuirecuvant.c:12:9: note: expected 'const char *' but argument is of type 'int *' inlocuirecuvant.c:12:9: warning: passing argument 2 of '__builtin_strcmp' from incompatible pointer type [enabled by default] inlocuirecuvant.c:12:9: note: expected 'const char *' but argument is of type 'int *' inlocuirecuvant.c:12:9: warning: passing argument 2 of '__builtin_strcmp' from incompatible pointer type [enabled by default] inlocuirecuvant.c:12:9: note: expected 'const char *' but argument is of type 'int *' inlocuirecuvant.c:12:9: warning: passing argument 1 of '__builtin_strlen' from incompatible pointer type [enabled by default] inlocuirecuvant.c:12:9: note: expected 'const char *' but argument is of type 'int *' inlocuirecuvant.c:12:9: warning: passing argument 2 of '__builtin_strcmp' from incompatible pointer type [enabled by default] inlocuirecuvant.c:12:9: note: expected 'const char *' but argument is of type 'int *' inlocuirecuvant.c:12:9: warning: passing argument 2 of '__builtin_strcmp' from incompatible pointer type [enabled by default] inlocuirecuvant.c:12:9: note: expected 'const char *' but argument is of type 'int *' inlocuirecuvant.c:13:13: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int *' [-Wformat=] printf("%s ", b); ^ inlocuirecuvant.c:7:10: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%s%s ", a, b); ^ inlocuirecuvant.c:8:10: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result] fgets(s, 102, stdin); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Raspuns gresit. | 25 | 0 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 25 | 0 | ||
3 | 0 secunde | Raspuns gresit. | 25 | 0 | ||
4 | 0 secunde | Raspuns gresit. | 25 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema InlocuireCuvant 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ă.