Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: PROb221
Problemset: ผลรวมของเลขหลัก
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-07 14:49:58
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
using namespace std;
int main()
{
long long int n,sum=0;
cin >> n;
while(n>0) {
sum+=n%10;
n/=10;
}
cout << sum;
return 0;
}