22199 数位之和
数位之和
https://ac.nowcoder.com/acm/problem/22199
#include<iostream>
using namespace std;
int main()
{
int a, b=0;
cin>>a;
while(a>=1)
{
b=b+a%10;
a=a/10;
}
cout<<b;
return 0;
}%和/不要记反了
数位之和
https://ac.nowcoder.com/acm/problem/22199
#include<iostream>
using namespace std;
int main()
{
int a, b=0;
cin>>a;
while(a>=1)
{
b=b+a%10;
a=a/10;
}
cout<<b;
return 0;
}%和/不要记反了
相关推荐
查看2道真题和解析
只想搞钱的鸽子很喜欢...:混账是很多的,还有那些在自己风华正茂的年纪说风凉话讥讽那些下岗前员工的。这些人都是现在职场环境这么烂的帮凶