Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale.h>
- using namespace std;
- int s(int a){
- int sum=0;
- while (a!=0){
- sum+=a%10;
- a=a/10;
- }
- return sum;
- }
- int main(void)
- {
- int i;
- for (i=10;i<=99;i++){
- if (s(i)==s(i*2)){
- cout<<i<<endl;
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment