Главная » 2019 » Декабрь » 4 » Функции C++ Методичка М. Сумма цифр
09:05
Функции C++ Методичка М. Сумма цифр

#include <iostream>
using namespace std;
void SummaCifr();
int c=-998;
int main(){
    SummaCifr();
    system("pause");
    return 0; 
}
void SummaCifr()
{
    cout<<"Vvedite posledovatelnost ";
    int a,s;
    cin>>a;
    while (a!=c)
    {
        s=0;
        while (a!=0)
        {
            s=s+a%10;
            a=a/10;
        }
        cout<<s<<endl;
        cin>>a;
    }
}

Просмотров: 300 | Добавил: denjes | Рейтинг: 0.0/0
Всего комментариев: 0
avatar