3 条题解
-
1
C :
#include<stdio.h> int main(){ int x; scanf("%d",&x); int b = x / 100; int s = x / 10 % 10; int g = x % 10; printf("%d",b+s+g); return 0; }
C++ :
#include<iostream> using namespace std; int main(){ int a,b,c,x,s; cin>>x; a=x/100; b=x/10%10; c=x%10; s=a+b+c; cout<<s<<endl; }
Python :
n=int(input()) a=n//100 b=n//10%10 c=n%10 print(a+b+c)
- 1
信息
- ID
- 63
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 1
- 标签
- 递交数
- 95
- 已通过
- 73
- 上传者