~cpp
// no10035 - Primary Arithmetic
#include <iostream>
#include <cstring>
using namespace std;
void main()
{
int num1[10], num2[10];
char str[22];
int i, j, temp, count, carry, sumCarry;
bool turn;
while (true)
{
cin.getline(str, 22, '\n');
if (strcmp(str, "0 0") == 0)
break;
turn = false;
count = 0;
for (i=strlen(str)-1; i>=0; i--)
{
if (turn)
num1[count++] = str[i] - 48;
else if (str[i] == ' ')
{
for (j=count; j<10; j++)
num2[j] = 0;
turn = true;
count = 0;
}
else
num2[count++] = str[i] - 48;
}
for (j=count; j<10; j++)
num1[j] = 0;
sumCarry = carry = 0;
for (i=0; i<10; i++)
{
temp = num1[i] + num2[i] + carry;
if (temp > 9)
{
carry = temp / 10;
sumCarry += carry;
}
else
carry = 0;
}
if (sumCarry == 0)
cout << "No carry operation.\n";
else if (sumCarry == 1)
cout << sumCarry << " carry operation.\n";
else
cout << sumCarry << " carry operations.\n";
}
}