#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
	//tarife pointer
	int *i, *x, *m;
	//gereftane fazaye hafeze baraye pointer ha
	i = new int;
	x = new int;
	m = new int;

	//pardazesh barname
	*m = 0;
	cout << "yek adad vared konid : ";
	cin >> *x;
	for(*i = 0; *x > 0; (*i)++)
	{
		*m += (*x) % 10;
		(*x) /= 10;
	}
	cout << "Jame Argham = " << *m << endl;

	//azad sazi fazaye hafeze baraye pointer ha
	delete i;
	delete x;
	delete m;

	getch();
}

