#includeusing namespace std;// 計算
int count(int a, int b){int box = 0, c = 0, d = 0;c = (a % 10 + b % 10);while (a != 0 || b != 0){if (c >= 10) // carry{box += 1;a /= 10;b /= 10;c = (a % 10 + b % 10) + 1;}else{a /= 10;b /= 10;}}return box;}
int main(){int a, b;int ans;while (cin >> a >> b){if (a == 0 && b == 0)break;ans = count(a, b);if (ans == 0)cout << "No carry operation." << endl;else if (ans < 2)cout << ans << " carry operation." << endl;elsecout << ans << " carry operations." << endl;}
return 0;}
不用咯 已解決