5 条题解
- 1
信息
- ID
- 614
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- 1
- 标签
- 递交数
- 219
- 已通过
- 147
- 上传者
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int a = n / 1000;
int b = n / 100 % 10;
int c = n / 10 % 10;
int d = n % 10;
cout << n + a + b + c + d;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int a=n/1000;
int b=n/100%10;
int c=n/10%10;
int d=n%10;
n = n + a + b + c + d;
cout << n;
return 0;
}
A
过辣!(脑残人士的欢呼)
long long n,sum=0;
cin>>n;
sum+=n;
sum+=n/1000;//千
sum+=n%10;//个
n/=10;
sum+=n%10;//十
n/=10;
sum+=n%10;
cout<<sum;
#include <iostream>//hetao3097453
using namespace std;
int main()
{
int n1;
cin >> n1;
int a = n1 % 10;
int b = n1 / 10 % 10;
int c = n1 / 100 % 10;
int d = n1 / 1000;
int n2 = a + b + c + d;
cout << n1 + n2 << endl;
return 0;
}