#include using namespace std; int even(int x){ return x/2; } int odd(int x){ return 3*x + 1; } int calc(int x){ if (x % 2 == 0) return even(x); else return odd(x); } void func(int a, int b){ int c, d, i = 0, j = 0; c = a; d = b; while (c != 1){ d = b; while(d != 1){ if (d == c) { cout<> a; cin >> b; if ( a == 0 && b == 0) return 0; func (a, b); } while(1); return 0; }