#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 | #64645973 | Utilizator | |
| Fișier | asociat.cpp | Dimensiune | 351 B |
| Data încărcării | 20 Mai 2026, 11:30 | Scor/rezultat | Eroare de compilare |
asociat.cpp: In function ‘int main()’: asociat.cpp:19:8: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 19 | if(s%2==0;s%3==0;s%5==0) | ^ asociat.cpp:19:11: warning: statement has no effect [-Wunused-value] 19 | if(s%2==0;s%3==0;s%5==0) | ~~~^~~ asociat.cpp:19:21: error: expected ‘)’ before ‘;’ token 19 | if(s%2==0;s%3==0;s%5==0) | ~ ^ | ) asociat.cpp:19:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 19 | if(s%2==0;s%3==0;s%5==0) | ^~ asociat.cpp:19:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 19 | if(s%2==0;s%3==0;s%5==0) | ^ asociat.cpp:19:28: error: expected ‘;’ before ‘)’ token 19 | if(s%2==0;s%3==0;s%5==0) | ^ | ; asociat.cpp:19:25: warning: statement has no effect [-Wunused-value] 19 | if(s%2==0;s%3==0;s%5==0) | ~~~^~~ asociat.cpp:21:5: error: ‘else’ without a previous ‘if’ 21 | else | ^~~~
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ă.