fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. int sir[22], i, lg_max = 0;
  7. string text[22];
  8. for (i = 1; !cin.eof(); i++) {
  9. getline(cin, text[i]);
  10. sir[i] = text[i].size();
  11. if (sir[i] > lg_max)
  12. lg_max = sir[i];
  13. }
  14. for (int j = 1; j < i; j++) {
  15. string stelute;
  16. for (int a = 1; a <= lg_max - sir[j]; a++)
  17. stelute = stelute + "*";
  18. text[j] = stelute + text[j];
  19. if (j < i - 1)
  20. cout << text[j].size() << " " << text[j] << "\n";
  21. }
  22. cout << text[i - 1];
  23. return 0;
  24. }
Success #stdin #stdout 0s 4416KB
stdin
Acesta*este
********un****text
***impartit*pe*mai
*multe*linii
stdout
18 *******Acesta*este
18 ********un****text
18 ***impartit*pe*mai
*******multe*linii