Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: RandomPerson

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-12 16:25:10

#include <iostream>
using namespace std;
int main() {
    long long int x;
    int ans=0;
    cin >> x;
    while (x!=0) {
        ans+=x%10;
        x/=10;
    }
    cout << ans;
    return 0;
}