用C++写一个程序,计算输入的正整数的各位数字的和并输出

谁能告诉我下哈,谢谢拉!!!!
2025-03-12 22:48:43
推荐回答(1个)
回答1:

#include用C++写一个程序,计算输入的正整数的各位数字的和并输出
void
main()
{
int
a
,t;
cout<<"please
input
a
number:";
cin>>a;
t+=a%10;
cout<}