#3078
prod_k
Scrieți un program care citește un număr natural n
și o cifră k
. Programul va calcula produsul P
al cifrelor lui n
diferite de cifra k
.
Problema | prod_k | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57770289 | Utilizator | |
Fișier | prod_k.cpp | Dimensiune | 164 B |
Data încărcării | 15 Aprilie 2025, 12:04 | Scor / rezultat | 100 puncte |
prod_k.cpp:3:8: warning: first argument of 'int main(long long int, long long int, long long int)' should be 'int' [-Wmain] signed main(int n,int k,int p){p=0;std::cin>>n>>k;while(n){if(n%10!=k){if(p==0)p=n%10;else p*=n%10;}n/=10;}std::cout<<p;} ^ prod_k.cpp:3:8: warning: second argument of 'int main(long long int, long long int, long long int)' should be 'char **' [-Wmain] prod_k.cpp:3:8: warning: third argument of 'int main(long long int, long long int, long long int)' should probably be 'char **' [-Wmain]
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 20 | 20 | Exemplu | |
2 | 0 secunde | OK. | 20 | 20 | ||
3 | 0 secunde | OK. | 20 | 20 | ||
4 | 0 secunde | OK. | 20 | 20 | ||
5 | 0 secunde | OK. | 20 | 20 | ||
Punctaj total | 100 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema prod_k 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ă.