#1494
s_p_c
Scrieţi un program care citeşte din fişierul de intrare şiruri de caractere de forma cuvânt#tip
, unde cuvânt
este un şir oarecare de litere iar tip
poate fi una din literele S
, P
sau C
, semnificaţia fiind subiect, predicat sau complement. Programul va afişa, în ordine lexicografică, toate propoziţiile având structura subiect predicat complement ce pot fi formate cu ajutorul cuvintelor citite. Datele de intrare se consideră a fi corecte.
Problema | s_p_c | Operații I/O |
s_p_c.in /s_p_c.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #16724755 | Utilizator | |
Fișier | s_p_c.cpp | Dimensiune | 1.46 KB |
Data încărcării | 17 Septembrie 2019, 22:40 | Scor / rezultat | Eroare de compilare |
s_p_c.cpp: In function 'int main()': s_p_c.cpp:15:32: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null] ceva[strlen(ceva) - 2] = NULL; ^ s_p_c.cpp:17:25: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(S[s++], ceva); ^ In file included from /usr/include/features.h:374:0, from /usr/include/assert.h:35, from /usr/include/c++/4.8/cassert:43, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:33, from s_p_c.cpp:1: /usr/include/i386-linux-gnu/bits/string3.h:102:1: error: initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive] __NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) ^ s_p_c.cpp:20:25: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(P[x++], ceva); ^ In file included from /usr/include/features.h:374:0, from /usr/include/assert.h:35, from /usr/include/c++/4.8/cassert:43, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:33, from s_p_c.cpp:1: /usr/include/i386-linux-gnu/bits/string3.h:102:1: error: initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive] __NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) ^ s_p_c.cpp:23:25: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(C[c++], ceva); ^ In file included from /usr/include/features.h:374:0, from /usr/include/assert.h:35, from /usr/include/c++/4.8/cassert:43, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:33, from s_p_c.cpp:1: /usr/include/i386-linux-gnu/bits/string3.h:102:1: error: initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive] __NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) ^ s_p_c.cpp:30:27: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if (strcmp(S[i], S[j]) == 1) { ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from s_p_c.cpp:1: /usr/include/string.h:144:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ s_p_c.cpp:30:33: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if (strcmp(S[i], S[j]) == 1) { ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from s_p_c.cpp:1: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ s_p_c.cpp:37:27: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if (strcmp(P[i], P[j]) == 1) { ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from s_p_c.cpp:1: /usr/include/string.h:144:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ s_p_c.cpp:37:33: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if (strcmp(P[i], P[j]) == 1) { ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from s_p_c.cpp:1: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ s_p_c.cpp:44:27: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if (strcmp(C[i], C[j]) == 1) { ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from s_p_c.cpp:1: /usr/include/string.h:144:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ s_p_c.cpp:44:33: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if (strcmp(C[i], C[j]) == 1) { ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from s_p_c.cpp:1: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema s_p_c 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ă.