#3596
Alexandru a invatat ca pe langa cifrele romane I, V, X, L, C, D, M mai exista cifrele (V), (X), (L), (C), (D), (M) care au valorile 5000, 10000, 50000, 100000, 500000 respectiv 1000000. Dandu-se un numar c:
c=1, se da un numar scris cu cifre arabe si trebuie sa-l scrieti cu cifre romane.c=2, se da un numar scris cu cifre romane si trebuie sa-l scrieti cu cifre arabe.proprie
| Problema | Cifre_romane2 | Operații I/O |
cifre_romane2.in/cifre_romane2.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64146830 | Utilizator | |
| Fișier | cifre_romane2.cpp | Dimensiune | 421 B |
| Data încărcării | 20 Aprilie 2026, 13:08 | Scor/rezultat | Eroare de compilare |
cifre_romane2.cpp:2:2: error: invalid preprocessing directive #icnlude; did you mean #include? 2 | #icnlude <fstream> | ^~~~~~~ | include cifre_romane2.cpp:7:46: warning: multi-character character constant [-Wmultichar] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:53: warning: multi-character character constant [-Wmultichar] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:60: warning: multi-character character constant [-Wmultichar] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:67: warning: multi-character character constant [-Wmultichar] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:74: warning: multi-character character constant [-Wmultichar] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:81: warning: multi-character character constant [-Wmultichar] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:5:14: error: variable ‘std::ifstream fin’ has initializer but incomplete type 5 | ifstream fin ("cifre_romane2.in"); | ^ cifre_romane2.cpp:6:14: error: variable ‘std::ofstream fout’ has initializer but incomplete type 6 | ofstream fout("cifre_romane2.out"); | ^ cifre_romane2.cpp:7:46: error: narrowing conversion of ‘2643497’ from ‘int’ to ‘char’ [-Wnarrowing] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:53: error: narrowing conversion of ‘2644009’ from ‘int’ to ‘char’ [-Wnarrowing] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:60: error: narrowing conversion of ‘2640937’ from ‘int’ to ‘char’ [-Wnarrowing] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:67: error: narrowing conversion of ‘2638633’ from ‘int’ to ‘char’ [-Wnarrowing] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:74: error: narrowing conversion of ‘2638889’ from ‘int’ to ‘char’ [-Wnarrowing] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:7:81: error: narrowing conversion of ‘2641193’ from ‘int’ to ‘char’ [-Wnarrowing] 7 | char s[]={'I', 'V', 'X', 'L', 'C', 'D', 'M', '(V)', '(X)', '(L)', '(C)', '(D)', '(M)'}; | ^~~~~ cifre_romane2.cpp:8:32: error: narrowing conversion of ‘500’ from ‘int’ to ‘char’ [-Wnarrowing] 8 | char num[]={1, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000}; | ^~~ cifre_romane2.cpp:8:37: error: narrowing conversion of ‘1000’ from ‘int’ to ‘char’ [-Wnarrowing] 8 | char num[]={1, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000}; | ^~~~ cifre_romane2.cpp:8:43: error: narrowing conversion of ‘5000’ from ‘int’ to ‘char’ [-Wnarrowing] 8 | char num[]={1, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000}; | ^~~~ cifre_romane2.cpp:8:49: error: narrowing conversion of ‘10000’ from ‘int’ to ‘char’ [-Wnarrowing] 8 | char num[]={1, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000}; | ^~~~~ cifre_romane2.cpp:8:56: error: narrowing conversion of ‘50000’ from ‘int’ to ‘char’ [-Wnarrowing] 8 | char num[]={1, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000}; | ^~~~~ cifre_romane2.cpp:8:63: error: narrowing conversion of ‘100000’ from ‘int’ to ‘char’ [-Wnarrowing] 8 | char num[]={1, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000}; | ^~~~~~ cifre_romane2.cpp:8:71: error: narrowing conversion of ‘500000’ from ‘int’ to ‘char’ [-Wnarrowing] 8 | char num[]={1, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000}; | ^~~~~~ cifre_romane2.cpp:8:79: error: narrowing conversion of ‘1000000’ from ‘int’ to ‘char’ [-Wnarrowing] 8 | char num[]={1, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000}; | ^~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cifre_romane2 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ă.