标签:com http blog style class div img code java javascript log
friend numbers = 2^x + 3^y -1
1 #include<stdio.h> 2 int main() 3 { 4 __int64 a; 5 while(scanf("%I64d",&a)!=EOF) 6 { 7 if(!a) 8 { 9 printf("NO!\n"); 10 continue; 11 } 12 a+=1; 13 while(a%2==0||a%3==0) 14 { 15 if(a%2==0) a/=2; 16 if(a%3==0) a/=3; 17 } 18 if(a==1) printf("YES!\n"); 19 else printf("NO!\n"); 20 } 21 }
HDU1719 Friend (数学推导),码迷,mamicode.com
标签:com http blog style class div img code java javascript log
原文地址:http://www.cnblogs.com/lqquan/p/3695976.html