#include <iostream>
int sumtorial( int value )
{
if ( value )
{
std::cout << value ;
if (value - 1)
std::cout << " + " ;
value += sumtorial(value-1) ;
}
return value ;
}
int main()
{
int result = sumtorial(6) ;
std::cout << " = " << result << '\n' ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IHN1bXRvcmlhbCggaW50IHZhbHVlICkKewogICAgaWYgKCB2YWx1ZSApCiAgICB7CiAgICAJc3RkOjpjb3V0IDw8IHZhbHVlIDsKICAgIAkKICAgIAlpZiAodmFsdWUgLSAxKQogICAgCQlzdGQ6OmNvdXQgPDwgIiArICIgOwogICAgCQkKICAgICAgICB2YWx1ZSArPSBzdW10b3JpYWwodmFsdWUtMSkgOwogICAgfQogICAgCiAgICByZXR1cm4gdmFsdWUgOwp9CgppbnQgbWFpbigpCnsKCWludCByZXN1bHQgPSBzdW10b3JpYWwoNikgOwogICAgc3RkOjpjb3V0IDw8ICIgPSAiIDw8IHJlc3VsdCA8PCAnXG4nIDsKfQ==