#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int a, ch1, ch2, ch3, sum;
cout<<"Input a: ";
cin>>a;
ch1=a/100;
ch2=a%100/10;
ch3=a%10;
sum = ch1+ch2+ch3;
cout<<"Sum = "<<sum<<endl;
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int a, ch1, ch2, ch3, sum;
cout<<"Input a: ";
cin>>a;
ch1=a/100;
ch2=a%100/10;
ch3=a%10;
sum = ch1+ch2+ch3;
cout<<"Sum = "<<sum<<endl;
return 0;
}