#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 | #47176741 | Utilizator | |
Fișier | email.cpp | Dimensiune | 764 B |
Data încărcării | 05 Decembrie 2023, 14:01 | Scor / rezultat | Eroare de compilare |
email.cpp:3:1: error: stray '\342' in program ifstream fin (“email.in”); ^ email.cpp:3:1: error: stray '\200' in program email.cpp:3:1: error: stray '\234' in program email.cpp:3:1: error: stray '\342' in program email.cpp:3:1: error: stray '\200' in program email.cpp:3:1: error: stray '\235' in program email.cpp:4:1: error: stray '\342' in program ofstream fout (“email.out”); ^ email.cpp:4:1: error: stray '\200' in program email.cpp:4:1: error: stray '\234' in program email.cpp:4:1: error: stray '\342' in program email.cpp:4:1: error: stray '\200' in program email.cpp:4:1: error: stray '\235' in program email.cpp:15:1: error: stray '\342' in program { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 0; ^ email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\231' in program email.cpp:15:54: error: stray '@' in program { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 0; ^ email.cpp:15:1: error: stray '\342' in program { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 0; ^ email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\231' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\235' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\234' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\231' in program email.cpp:15:1: error: stray '\' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\231' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\231' in program email.cpp:15:1: error: stray '\' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\231' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\235' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\234' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\235' in program email.cpp:15:1: error: stray '\' in program email.cpp:15:1: error: stray '\342' in program email.cpp:15:1: error: stray '\200' in program email.cpp:15:1: error: stray '\235' in program email.cpp:3:18: error: 'email' was not declared in this scope ifstream fin (“email.in”); ^ email.cpp:4:19: error: 'email' was not declared in this scope ofstream fout (“email.out”); ^ email.cpp: In function 'int main()': email.cpp:15:31: error: 's' was not declared in this scope { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 0; ^ email.cpp:15:58: error: expected primary-expression before ')' token { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 0; ^ email.cpp:15:147: error: expected primary-expression before '<<' token { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 0; ^ email.cpp:15:165: error: 'n' was not declared in this scope { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 0; ^ email.cpp:15:219: error: 'z' was not declared in this scope { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 0; ^ email.cpp:15:271: error: 'z' was not declared in this scope { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 0; ^ email.cpp:15:349: error: expected primary-expression before '<<' token { string x; while(fin.getline(s,50)) { p=strchr(s,’@’); x=string(p+1); d[x]++; } for(it=d.begin();it!=d.end();++it) { cout<<it->first<<” “<<it->second<<’\n’; } int n=0; for(it=d.begin();it!=d.end();++it) { z[n].dom=it->first; z[n].fr=it->second; n++; } sort(z,z+n,comp); fout<<n<<’\n’; for(int i=0;i<n;i++) { fout<<z[i].dom<<” “<<z[i].fr<<”\n”; } fin.close(); fout.close(); return 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ă.