Ответ:
#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);
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
#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);
}