Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: bananatomyum2
Problemset: ผลรวมของเลขหลัก
Language: cpp
Time: 0.003 second
Submitted On: 2025-09-29 14:07:47
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);
long long x,y,re;
cin >> x;
re = 0;
while(x){
y = x % 10;
re = re+y;
x = x / 10;
}
cout << re << "\n";
return 0;
}
// 15616516 1
//0 0