Untitled

Anonymous
plain_text
10/15/2023 9:46 AM
252 B
18
Indexable
#include<string>
#include <iostream>
using namespace std;
int main()
{
	int a,b=0;
	int i= 0;
	cin >> a;
	while (a>0) {
		b += a % 10;
		i++;
		a /= 10;
	}
	cout << b;

}
Editor is loading...