1390A.cpp 355 B

12345678910111213141516171819
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. int n;
  5. cin >> n;
  6. while (n > 1) {
  7. if (n & 1) {
  8. cout << n << "*3+1=";
  9. n = 3 * n + 1;
  10. cout << n << endl;
  11. }
  12. else {
  13. cout << n << "/2=";
  14. n /= 2;
  15. cout << n << endl;
  16. }
  17. }
  18. return 0;
  19. }