12345678910111213141516171819 |
- #include<bits/stdc++.h>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- while (n > 1) {
- if (n & 1) {
- cout << n << "*3+1=";
- n = 3 * n + 1;
- cout << n << endl;
- }
- else {
- cout << n << "/2=";
- n /= 2;
- cout << n << endl;
- }
- }
- return 0;
- }
|