Технология программирования
C++
Главная »
2017 » Октябрь » 30 » 3_31
|
#include <iostream>
using namespace std;
int main()
{
int a,b,s=0;
cin>>a;
while (a>0)
{
b=a%10;
s=s+b;
a=a/10;
}
cout<<s<<endl;
system("pause");
return 0;
}
|
Просмотров: 326 |
Добавил: denjes
| Рейтинг: 0.0/0 |