#3667
Se dau n
numere naturale. Determinaţi câte dintre ele au cifra maximă un număr impar.
Problema | cifmaximp | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #35393923 | Utilizator | |
Fișier | cifmaximp.cpp | Dimensiune | 264 B |
Data încărcării | 08 Martie 2022, 09:43 | Scor / rezultat | Eroare de compilare |
cifmaximp.cpp: In function 'int main()': cifmaximp.cpp:7:15: error: expected initializer before 'max' int n,c,c max; cin>>n; ^ cifmaximp.cpp:8:7: error: expected ';' before 'max' c max=0; ^ cifmaximp.cpp:8:12: warning: statement has no effect [-Wunused-value] c max=0; ^ cifmaximp.cpp:10:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>' {c=n%10; if(c%2==1 and c>max) c max=o; ^ cifmaximp.cpp:10:37: error: expected ';' before 'max' {c=n%10; if(c%2==1 and c>max) c max=o; ^ cifmaximp.cpp:10:42: warning: statement has no effect [-Wunused-value] {c=n%10; if(c%2==1 and c>max) c max=o; ^ cifmaximp.cpp:12:12: error: expected ')' before 'max' if (c max==0) cout<<"nu exista"; ^ cifmaximp.cpp:13:19: error: expected ';' before 'max' else cout<<c max; ^ cifmaximp.cpp:15:5: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cifmaximp 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ă.