// Primary arithmetic (pupils arithmetic) // PC/Ultraviolet IDs: 110501/10035, popularity: A, success rate: average level: 1 // verdict: accepted // submission date: 2011-05-27 // UV Run Time: 0.068 S // copyright (c) 2011, Qiu. Metaphysis # Yeah dot net // because it is only a statistical carry, you do not need to save the Add result. You can use this. Pay attention to the differences in the output singular and plural numbers. # Include <iostream> using namespace STD; int main (int ac, char * AV []) {int first, second; while (CIN> first> second, first | second) {int carry = 0; int counter = 0; while (first & Second) {carry = (first % 10 + second % 10 + carry)> 9 )? 1: 0); counter + = carry; first/= 10; second/= 10;} while (first) {carry = (first % 10 + carry> 9 )? 1: 0); counter + = carry; first/= 10;} while (second) {carry = (second % 10 + carry> 9 )? 1: 0); counter + = carry; second/= 10;} If (counter> 1) cout <counter <"carry operations. "<Endl; else if (counter = 1) cout <" 1 carry operation. "<Endl; elsecout <" No carry operation. "<Endl;} return 0 ;}