Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "Russian");
- int input;
- cout << "Введите число:\n";
- cin >> input;
- while(input > 0)
- {
- cout << "Ответ:" << (input / 10) / 10 + (input / 10) % 10 + input % 10;
- cout << "\n-----------------";
- return 0;
- }
- //cout << "Ответ:\n" << (input / 10) / 10 + (input / 10) % 10 + input % 10;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement