fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. #include <stdio.h>
  5. #include <iostream>
  6. #include <cstring>
  7.  
  8.  
  9. int main()
  10. {
  11. std::string s = "hello world", s1 = "";
  12. size_t j = 0, i = 0;
  13.  
  14. while (s[i] != '\0')
  15. {
  16. if (s[i] != ' ')
  17. s1 += s[i];
  18. i++;
  19. }
  20. s = s1;
  21. s1 = " ";
  22. i = 0;
  23. std::cout << s << "\n";
  24. while (s.size() % 4 != 0)
  25. s += '0';
  26. std::cout << s << "\n";
  27.  
  28. while (s[i] != '\0')
  29. {
  30. s1 += s[i];
  31. i += 2;
  32. }
  33. std::cout << s1 << "\n";
  34. i = 1;
  35. std::cout << s1 << "\n";
  36. while (s[i] != '\0')
  37. {
  38. s1 += s[i];
  39. i += 2;
  40. }
  41. std::cout << s1 << "\n";
  42.  
  43. i = 0;
  44. s = "";
  45. while (s1[i] != '\0')
  46. {
  47. s += s1[i];
  48. i++;
  49. j++;
  50. if (j == 4)
  51. {
  52. s += ' ';
  53. j = 0;
  54. }
  55. }
  56. std::cout << s << "\n";
  57.  
  58.  
  59. system("pause");
  60. return 0;
  61. }
  62.  
Success #stdin #stdout #stderr 0s 4536KB
stdin
Standard input is empty
stdout
helloworld
helloworld00
 hlool0
 hlool0
 hlool0elwrd0+
 hlo ol0e lwrd 0+
stderr
sh: 1: pause: not found