#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 | #63514394 | Utilizator | |
| Fișier | asociat.cpp | Dimensiune | 436 B |
| Data încărcării | 06 Martie 2026, 13:54 | Scor/rezultat | Eroare de compilare |
asociat.cpp:2:7: error: expected nested-name-specifier before 'namespce' using namespce std; ^ asociat.cpp:2:7: error: 'namespce' has not been declared asociat.cpp:2:16: error: expected ';' before 'std' using namespce std; ^ asociat.cpp:2:16: error: 'std' does not name a type asociat.cpp: In function 'int main()': asociat.cpp:6:5: error: 'cin' was not declared in this scope cin>>a>>b; ^ asociat.cpp:6:5: note: suggested alternative: In file included from asociat.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ asociat.cpp:8:9: error: 'sa' was not declared in this scope sa=sa+a%10; ^ asociat.cpp:11:7: error: 'sa' was not declared in this scope a=sa; ^ asociat.cpp:14:9: error: 'sb' was not declared in this scope sb=sb+b%10; ^ asociat.cpp:17:7: error: 'sb' was not declared in this scope b=sb; ^ asociat.cpp:23:9: error: 'cout' was not declared in this scope cout<<"DA"; ^ asociat.cpp:23:9: note: suggested alternative: In file included from asociat.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ asociat.cpp:25:9: error: 'cout' was not declared in this scope cout<<"NU"; ^ asociat.cpp:25:9: note: suggested alternative: In file included from asociat.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
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ă.