Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: speed_coding

Problemset: ผลรวมของเลขหลัก

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-04 21:15:10

#include<bits/stdc++.h>
using namespace std;
int main(){
	string num_str;
	cin >> num_str;
    int n = num_str.length() ;
	int total_sum = 0;
	for(int i = 0; i < n; i++){
		total_sum =total_sum + (num_str[i] - '0') ;
	}
	cout << total_sum << "\n" ;
	return 0;
}