#3275
nrSumCifMax
Se dau 3
numere naturale, fiecare având câte două cifre. Afișați-le pe acelea care au suma cifrelor maximă.
CNFB - Concurs de pregatire, clasa a 5-a
Problema | nrSumCifMax | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #22076115 | Utilizator | |
Fișier | nrsumcifmax.cpp | Dimensiune | 346 B |
Data încărcării | 24 Martie 2020, 17:26 | Scor / rezultat | Eroare de compilare |
nrsumcifmax.cpp: In function 'int main()': nrsumcifmax.cpp:8:14: error: invalid operands of types 'double' and 'int' to binary 'operator%' summax=a%10+a/10; ^ nrsumcifmax.cpp:9:10: error: invalid operands of types 'double' and 'int' to binary 'operator%' if(b%10+b/10>summax) summax=b; ^ nrsumcifmax.cpp:10:10: error: invalid operands of types 'double' and 'int' to binary 'operator%' if(c%10+c/10>summax) summax=c; ^ nrsumcifmax.cpp:11:9: error: invalid operands of types 'double' and 'int' to binary 'operator%' if(a%10+a/10==summax) cout<<a<<" "; ^ nrsumcifmax.cpp:12:9: error: invalid operands of types 'double' and 'int' to binary 'operator%' if(b%10+b/10==summax) cout<<b<<" "; ^ nrsumcifmax.cpp:13:9: error: invalid operands of types 'double' and 'int' to binary 'operator%' if(c%10+c/10==summax) cout<<c<<" "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema nrSumCifMax 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ă.