#530
Se dau două mulțimi de numere naturale. Să se afișeze reuniunea și intersecția lor.
| Problema | Multimi1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64809402 | Utilizator | |
| Fișier | multimi1.cpp | Dimensiune | 1.41 KB |
| Data încărcării | 02 Iunie 2026, 18:32 | Scor/rezultat | Eroare de compilare |
multimi1.cpp: In function ‘int main()’: multimi1.cpp:11:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 11 | for(int i=1;i<=n;i++) | ^~~ multimi1.cpp:13:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | for (int i=1;i<=n-1;i++) | ^~~ multimi1.cpp:21:10: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 21 | for(int l=1+j;l<=m;l++) | ^~~ multimi1.cpp:24:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 24 | if(nr=1){ | ^~ multimi1.cpp:24:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 24 | if(nr=1){ | ~~^~ multimi1.cpp:54:10: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 54 | if(i<=n) | ^~ multimi1.cpp:55:14: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 55 | k++;d[k]=v[i];i++; | ^ multimi1.cpp:57:10: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 57 | if(j<=m) | ^~ multimi1.cpp:58:14: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 58 | k++;d[k]=w[j];j++; | ^ multimi1.cpp:7:78: warning: unused variable ‘o’ [-Wunused-variable] 7 | int n,m,i,j,c[1001]/*reuniune*/,d[1001]/*intersectie*/,v[1001],w[1001],k,o[1001]/*diferenta*/,nr; | ^ multimi1.cpp: At global scope: multimi1.cpp:65:9: error: expected unqualified-id before ‘return’ 65 | return 0; | ^~~~~~ multimi1.cpp:66:1: error: expected declaration before ‘}’ token 66 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Multimi1 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ă.