DEV Community

Cover image for name input = multi digit number = digit plus digit <= 9 = answer
William Brock
William Brock

Posted on

name input = multi digit number = digit plus digit <= 9 = answer

im lost, first half works second part i have no idea disambiguos parenthesis and expected declaration errors

include < iostream>

include < cctype>

include < string>

using namespace std;

int main()
{
cout << "Present Name." << endl;
string named {};
getline(cin, named);
int sum{};
for (auto& key : named)
{
if(isalpha(key))
{
key = toupper(key);
sum += static_cast(key - 'A' + 1);
int second()
{
int num = 0;
while(1)
{
int num;
num += (sum % 10);
sum /= 10;
if(0 == sum)
{
if(num > 9)
{
sum = num;
num = 0;
}
else
{
cout << num << endl;
system("pause");
return 0;
}
}
};
}
}
}
}

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay