北京师范大学珠海分校
Judge Online of ACM ICPC
1069 辉蛋VS佳佳
C语言版
Judge Online of ACM ICPC
1069 辉蛋VS佳佳
C语言版
- #include <stdio.h>
- int n;
- int work(){
- int sign=9;
- while (n>9){
- if (n%sign==0) n/=sign;
- else n=n/sign+1;
- if (sign==9) sign=2;
- else sign=9;
- }
- if (sign==9) return 1;
- else{
- if (sign==2&&n>2) return 1;
- else return 0;
- }
- }
- int main(){
- while(1){
- scanf("%d",&n);
- if (n==0) break;
- if (work()) printf("Huidan wins!/n");
- else printf("Jiajia wins!/n");
- }
- return 0;
- }