6 条题解
-
312203沈宇阳 (12203沈宇阳) LV 8 @ 2021-11-15 09:38:03
#include<iostream>
using namespace std;
int main()
{
int n,s=0;
cin>>n;
while(n!=0)
{
s+=n%10;
n/=10;
}
cout<<s<<endl;
return 0;
} -
12024-07-22 08:53:05@
#include<iostream> using namespace std; int main() { int a,sum=0; cin>>a; while(a!=0) { sum=sum+a%10; a=a/10; } cout<<sum<<endl; }
-
12024-07-09 08:10:20@
#include<bits/stdc++.h>
using namespace std;
int main()
{
int y=0,n,sum=0;
cin>>n;
while(n!=0)
{
y=n%10;
sum=sum+y;
n=n/10;
}
cout<<sum;
return 0;
} -
02024-07-09 08:08:47@
#include<bits/stdc++.h>
using namespace std;
int main()
{
int y=0,n,sum=0;
cin>>n;
while(n!=0)
{
y=n%10;
sum=sum+y;
n=n/10;
}
cout<<sum;
return 0;
} -
-12024-08-01 15:31:02@
include<bits/stdc++.h>
using namespace std;
int main()
{
int y=0,n,sum=0;
cin>>n;
while(n!=0)
{
y=n%10;
sum=sum+y;
n=n/10;
}
cout<<sum;
return 0;}
-
-42021-04-30 21:41:31@
#include<bits/stdc++.h> using namespace std; int main(){ string a; getline(cin,a); int cnt=0; string::iterator it=a.begin(); for(;it!=a.end();it++) cnt+=*it-48; cout<<cnt; return 0; }
- 1
信息
- ID
- 1059
- 难度
- 2
- 分类
- (无)
- 标签
- 递交数
- 273
- 已通过
- 159
- 通过率
- 58%
- 上传者