#4867
Două numere naturale se numesc asociate dacă sumele cifrelor lor se împart exact la 2 sau la 3 sau la 5.
Date două numere naturale a și b, să se verifice dacă sunt asociate.
Concurs de selecție clasa a 9-a Centru de Excelență in Informatică 2025 - Vaslui
| Problema | Asociat | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64423653 | Utilizator | |
| Fișier | asociat.cpp | Dimensiune | 562 B |
| Data încărcării | 06 Mai 2026, 10:36 | Scor/rezultat | Eroare de compilare |
asociat.cpp: In function ‘int main()’: asociat.cpp:19:16: error: expected ‘)’ before ‘;’ token 19 | if((s1%2==0;s1%3==0;s1%5==0)&&(s2%2==0;s2%3==0;)) cout<<"DA"; | ~ ^ | ) asociat.cpp:19:16: error: expected ‘)’ before ‘;’ token 19 | if((s1%2==0;s1%3==0;s1%5==0)&&(s2%2==0;s2%3==0;)) cout<<"DA"; | ~ ^ | ) asociat.cpp:19:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 19 | if((s1%2==0;s1%3==0;s1%5==0)&&(s2%2==0;s2%3==0;)) cout<<"DA"; | ^~ asociat.cpp:19:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 19 | if((s1%2==0;s1%3==0;s1%5==0)&&(s2%2==0;s2%3==0;)) cout<<"DA"; | ^~ asociat.cpp:19:21: warning: statement has no effect [-Wunused-value] 19 | if((s1%2==0;s1%3==0;s1%5==0)&&(s2%2==0;s2%3==0;)) cout<<"DA"; | ~~~~^~~ asociat.cpp:19:32: error: expected ‘;’ before ‘)’ token 19 | if((s1%2==0;s1%3==0;s1%5==0)&&(s2%2==0;s2%3==0;)) cout<<"DA"; | ^ | ; asociat.cpp:19:29: warning: statement has no effect [-Wunused-value] 19 | if((s1%2==0;s1%3==0;s1%5==0)&&(s2%2==0;s2%3==0;)) cout<<"DA"; | ~~~~^~~ asociat.cpp:19:48: warning: statement has no effect [-Wunused-value] 19 | if((s1%2==0;s1%3==0;s1%5==0)&&(s2%2==0;s2%3==0;)) cout<<"DA"; | ~~~~^~~ asociat.cpp:19:52: error: expected primary-expression before ‘)’ token 19 | if((s1%2==0;s1%3==0;s1%5==0)&&(s2%2==0;s2%3==0;)) cout<<"DA"; | ^ asociat.cpp:20:5: error: ‘else’ without a previous ‘if’ 20 | else cout<<"NU"; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Asociat 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ă.