Guest User

Untitled

a guest
Dec 15th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <locale.h>
  3.  
  4. using namespace std;
  5.  
  6. int s(int a){
  7. int sum=0;
  8. while (a!=0){
  9. sum+=a%10;
  10. a=a/10;
  11. }
  12. return sum;
  13. }
  14.  
  15. int main(void)
  16. {
  17. int i;
  18.  
  19. for (i=10;i<=99;i++){
  20. if (s(i)==s(i*2)){
  21. cout<<i<<endl;
  22.  
  23. }
  24. }
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment