Advertisement
Guest User

lolololol

a guest
Mar 25th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. setlocale(LC_ALL, "Russian");
  6.  
  7. int input;
  8.  
  9. cout << "Введите число:\n";
  10. cin >> input;
  11.  
  12. while(input > 0)
  13. {
  14. cout << "Ответ:" << (input / 10) / 10 + (input / 10) % 10 + input % 10;
  15. cout << "\n-----------------";
  16. return 0;
  17. }
  18.  
  19. //cout << "Ответ:\n" << (input / 10) / 10 + (input / 10) % 10 + input % 10;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement