Untitled

 avatar
unknown
plain_text
2 years ago
210 B
3
Indexable
#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 << " ";
	}
Editor is loading...