fork(1) download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(void)
  5. {
  6. cin.tie(NULL);
  7. ios::sync_with_stdio(false);
  8.  
  9. string a, b;
  10. cin >> a;
  11.  
  12. for (int i = 0; a[i] != '\0'; i++)
  13. {
  14. if (a[i] - 48 == 0)
  15. {
  16. b.push_back('0');
  17. b.push_back('0');
  18. b.push_back('0');
  19. }
  20. if (a[i] - 48 == 1)
  21. {
  22. b.push_back('0');
  23. b.push_back('0');
  24. b.push_back('1');
  25. }
  26. if (a[i] - 48 == 2)
  27. {
  28. b.push_back('0');
  29. b.push_back('1');
  30. b.push_back('0');
  31. }
  32. if (a[i] - 48 == 3)
  33. {
  34. b.push_back('0');
  35. b.push_back('1');
  36. b.push_back('1');
  37. }
  38. if (a[i] - 48 == 4)
  39. {
  40. b.push_back('1');
  41. b.push_back('0');
  42. b.push_back('0');
  43. }
  44. if (a[i] - 48 == 5)
  45. {
  46. b.push_back('1');
  47. b.push_back('0');
  48. b.push_back('1');
  49. }
  50. if (a[i] - 48 == 6)
  51. {
  52. b.push_back('1');
  53. b.push_back('1');
  54. b.push_back('0');
  55. }
  56. if (a[i] - 48 == 7)
  57. {
  58. b.push_back('1');
  59. b.push_back('1');
  60. b.push_back('1');
  61. }
  62. }
  63. if (b[0] - 48 == 0 && b[1] - 48 == 0 && b[2] - 48 == 0)
  64. {
  65. cout << b;
  66. return 0;
  67. }
  68. else if (b[0] - 48 == 0 && b[1] - 48 == 0)
  69. {
  70. for (int i = 2; b[i] != '\0'; i++)
  71. {
  72. cout << b[i];
  73. }
  74. return 0;
  75. }
  76. else if (b[0]-48 == 0)
  77. {
  78. for (int i = 1; b[i] != '\0'; i++)
  79. {
  80. cout << b[i];
  81. }
  82. return 0;
  83. }
  84. else
  85. {
  86. cout << b;
  87. return 0;
  88. }
  89. }
Success #stdin #stdout 0.01s 5412KB
stdin
0
stdout
000