#include<iostream>
int main()
{
int sum = 0, val = 10;
while (val > 0)
{
std::cout << sum
<< "+"
<< val
<< "=";
sum += val;
std::cout << sum << "\n";
--val;
}
std::cout << "Sum of 1 to 10 =" << sum << std::endl;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CgppbnQgbWFpbigpCnsKCWludCBzdW0gPSAwLCB2YWwgPSAxMDsKCgoJd2hpbGUgKHZhbCA+IDApIAoJeyAKCQlzdGQ6OmNvdXQgPDwgc3VtCgkJCQkgIDw8ICIrIgoJCQkJICA8PCB2YWwKCQkJCSAgPDwgIj0iOwoJCQkJICAKCQlzdW0gKz0gdmFsOyAKCQkKCXN0ZDo6Y291dCA8PCBzdW0gPDwgIlxuIjsKCQktLXZhbDsgCgl9CglzdGQ6OmNvdXQgPDwgIlN1bSBvZiAxIHRvIDEwID0iIDw8IHN1bSA8PCBzdGQ6OmVuZGw7CgoJcmV0dXJuIDA7CgoKfQ==