#365
Se citesc două numere naturale n și m. Să se decidă dacă cele două numere au cel puțin o cifră comună.
| Problema | Cifre comune | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64776962 | Utilizator | |
| Fișier | cifre_comune.cpp | Dimensiune | 263 B |
| Data încărcării | 29 Mai 2026, 17:08 | Scor/rezultat | 40 puncte |
cifre_comune.cpp: In function ‘int main()’: cifre_comune.cpp:14:16: warning: self-comparison always evaluates to true [-Wtautological-compare] 14 | if (c==c2 && c2==c2 && c==c) cout<<"NU"; | ~~^~~~ cifre_comune.cpp:14:25: warning: self-comparison always evaluates to true [-Wtautological-compare] 14 | if (c==c2 && c2==c2 && c==c) cout<<"NU"; | ~^~~ cifre_comune.cpp:4:19: warning: unused variable ‘i’ [-Wunused-variable] 4 | long long int n,m,i,j,c,c2; | ^ cifre_comune.cpp:4:21: warning: unused variable ‘j’ [-Wunused-variable] 4 | long long int n,m,i,j,c,c2; | ^ cifre_comune.cpp:14:1: warning: ‘c’ may be used uninitialized [-Wmaybe-uninitialized] 14 | if (c==c2 && c2==c2 && c==c) cout<<"NU"; | ^~ cifre_comune.cpp:4:23: note: ‘c’ was declared here 4 | long long int n,m,i,j,c,c2; | ^ cifre_comune.cpp:14:1: warning: ‘c2’ may be used uninitialized [-Wmaybe-uninitialized] 14 | if (c==c2 && c2==c2 && c==c) cout<<"NU"; | ^~ cifre_comune.cpp:4:25: note: ‘c2’ was declared here 4 | long long int n,m,i,j,c,c2; | ^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.003 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 6 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 40 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cifre comune 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ă.