Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
210 B
1
Indexable
Never
#include <iostream>
#include <string>
using namespace std;

int main()
{
	
	int a, b = 0;
	int i = 0;
	cin >> a;
	while (a > 0)
	{	
		i++;
		b += a % 10;
		a /= 10;

	}
	cout << b << " ";
	}