Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Gun555XD
Problemset: ผลรวมของเลขหลัก
Language: cpp
Time: 0.002 second
Submitted On: 2026-05-24 15:13:41
#include <bits/stdc++.h>
using namespace std;
int main() {
string n ;
cin >> n;
int len = n.length() ;
int total = 0 ;
for(int i = 0 ; i < len ; i++) {
int num = n[i] - '0';
total += num ;
}
cout << total ;
return 0;
}