#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 | #64182834 | Utilizator | |
| Fișier | textoji.cpp | Dimensiune | 1.55 KB |
| Data încărcării | 21 Aprilie 2026, 22:58 | Scor/rezultat | 80 puncte |
textoji.cpp: In function ‘void print(std::vector<std::__cxx11::basic_string<char> >&, int)’: textoji.cpp:20:20: 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] 20 | for (auto i=0;i<line.size();i++) { | ~^~~~~~~~~~~~ textoji.cpp: In function ‘int main()’: textoji.cpp:52:24: 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] 52 | for (auto i=0;i<words.size();i++) { | ~^~~~~~~~~~~~~ textoji.cpp:67:28: 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] 67 | for (auto i=0;i<line.size();i++) | ~^~~~~~~~~~~~ textoji.cpp:35:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 35 | freopen("textoji.in","r",stdin); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ textoji.cpp:36:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 36 | freopen("textoji.out","w",stdout); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
| 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.002 secunde | OK. | 10 | 10 | ||
| 3 | 0.001 secunde | OK. | 10 | 10 | ||
| 4 | 0.001 secunde | OK. | 10 | 10 | ||
| 6 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| 8 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0.001 secunde | OK. | 20 | 20 | ||
| Punctaj total | 80 | |||||
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ă.