#851
Email
Se dă o listă de adrese de email corecte ca structură. Să se determine câte adrese de email sunt asociate cu fiecare nume de domeniu.
Problema | Operații I/O |
email.in /email.out
|
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53709166 | Utilizator | |
Fișier | email.cpp | Dimensiune | 901 B |
Data încărcării | 09 Noiembrie 2024, 11:08 | Scor / rezultat | Eroare de compilare |
email.cpp: In function 'int main()': email.cpp:25:36: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if (strcmp(v[i].dom, a)==0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from email.cpp:3: /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) ^ email.cpp:31:32: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(v[n].dom, a); ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iosfwd:38, from /usr/include/c++/4.8/ios:38, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from email.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)) ^ email.cpp:37:80: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if (v[i].nr<v[j].nr || v[i].nr==v[j].nr && strcmp(v[i].dom,v[j].dom)>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from email.cpp:3: /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) ^ email.cpp:37:80: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if (v[i].nr<v[j].nr || v[i].nr==v[j].nr && strcmp(v[i].dom,v[j].dom)>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from email.cpp:3: /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) ^ email.cpp:37:53: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if (v[i].nr<v[j].nr || v[i].nr==v[j].nr && strcmp(v[i].dom,v[j].dom)>0) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Email 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ă.