#4253
textOJI
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 | #43203453 | Utilizator | |
Fișier | textoji.cpp | Dimensiune | 1.83 KB |
Data încărcării | 06 Aprilie 2023, 13:48 | Scor / rezultat | 10 puncte |
textoji.cpp: In function 'void print(std::string, bool)': textoji.cpp:18:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i < line.length(); ++ i) ^ textoji.cpp:32:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i < line.length(); ++ i) ^ textoji.cpp: In function 'void format(char*)': textoji.cpp:52:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i < strlen(s); ++ i) ^ textoji.cpp:55:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(sir.length() == maxi || strlen(s) - 1 == i) ^ textoji.cpp:55:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(sir.length() == maxi || strlen(s) - 1 == i) ^ textoji.cpp:59:72: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while(sir[sir.length() - 1] != ' ' && strlen(s) - 1 != i) ^ textoji.cpp:61:72: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while(sir[sir.length() - 1] == ' ' && strlen(s) - 1 != i) ^ textoji.cpp:64:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] print(sir, (strlen(s) - 1 == i)); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
0 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
1 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
2 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
3 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
4 | 0 secunde | OK. | 10 | 10 | ||
5 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
6 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
7 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
8 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
9 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
Punctaj total | 10 |
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ă.