Untitled
unknown
c_cpp
2 years ago
223 B
8
Indexable
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int a,sum = 0;
cin >> a;
while (a != 0) {
sum += a % 10;
a /= 10;
}
cout << sum;
return 0;
}Editor is loading...