#1335
Caractere
Se dau 2
șiruri de caractere. Sa se afișeze toate caracterele primului șir ce se găsesc și în al doilea.
Problema | Caractere | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54284785 | Utilizator | |
Fișier | caractere.cpp | Dimensiune | 671 B |
Data încărcării | 24 Noiembrie 2024, 19:21 | Scor / rezultat | Eroare de compilare |
caractere.cpp: In function 'int main()': caractere.cpp:12:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( i = 0; i < strlen( s ); i++ ) ^ caractere.cpp:13:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( j = i + 1; j < strlen( s ); j++ ) ^ caractere.cpp:14:26: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if( strcmp( s[ i ], s[ j ] ) > 0 ) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from caractere.cpp:2: /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) ^ caractere.cpp:14:34: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if( strcmp( s[ i ], s[ j ] ) > 0 ) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from caractere.cpp:2: /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) ^ caractere.cpp:17:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( i = 0; i < strlen( t ); i++ ) ^ caractere.cpp:18:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( j = i + 1; j < strlen( t ); j++ ) ^ caractere.cpp:19:26: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if( strcmp( t[ i ], t[ j ] ) > 0 ) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from caractere.cpp:2: /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) ^ caractere.cpp:19:34: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if( strcmp( t[ i ], t[ j ] ) > 0 ) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from caractere.cpp:2: /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) ^ caractere.cpp:22:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( i = 0; i < strlen( s ); i++ ) ^ caractere.cpp:23:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for( j = 0; j < strlen( t ); j++ ) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Caractere 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ă.