#4253
Scrieţi un program care să citească lungimea unei linii şi textul dat şi care să alinieze textul la stânga şi la dreapta.
OJI 2003, clasa a IX-a
| Problema | textOJI | Operații I/O |
textoji.in/textoji.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64460408 | Utilizator | |
| Fișier | textoji.cpp | Dimensiune | 1.51 KB |
| Data încărcării | 08 Mai 2026, 08:52 | Scor/rezultat | 100 puncte |
textoji.cpp: In function ‘void solve()’: textoji.cpp:18:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 18 | for(int i = 0; i < v.size(); ++i) { | ~~^~~~~~~~~~ textoji.cpp:19:41: warning: comparison of integer expressions of different signedness: ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 19 | if(l + v[i].size() + aux.size() <= k) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ textoji.cpp:25:37: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 25 | for(int j = 0, r = 0; j < aux.size(); ++j, ++r) { | ~~^~~~~~~~~~~~ textoji.cpp:15:16: warning: unused variable ‘i’ [-Wunused-variable] 15 | int l = 0, i = 0; | ^ textoji.cpp: In function ‘int main()’: textoji.cpp:53:26: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 53 | for(int i = 0; i < s.size(); ++i) { | ~~^~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.001 secunde | OK. | 10 | 10 | ||
| 1 | 0.001 secunde | OK. | 10 | 10 | ||
| 2 | 0.001 secunde | OK. | 10 | 10 | ||
| 3 | 0.001 secunde | OK. | 10 | 10 | ||
| 4 | 0.001 secunde | OK. | 10 | 10 | ||
| 6 | 0.001 secunde | OK. | 10 | 10 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| 8 | 0.001 secunde | OK. | 10 | 10 | ||
| 9 | 0.001 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema textOJI 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ă.