#include <iostream>
using namespace std;
double getfunction1(int n)
{ int sum = 0;
while (n!=0)
{ sum += n%10;
n /= 10; }
return sum;
}
int main()
{
int t;
cout << "Input number " << endl;
cin >> t;
do { t=getfunction1(t);
cout << t << endl; }
while (t > 9);
#include <iostream>
using namespace std;
double getfunction1(int n)
{ int sum = 0;
while (n!=0)
{ sum += n%10;
n /= 10; }
return sum;
}
int main()
{
int t;
cout << "Input number " << endl;
cin >> t;
do { t=getfunction1(t);
cout << t << endl; }
while (t > 9);
}