#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main() { int inp; while((scanf("%d",&inp)!=EOF) && inp ) { if((inp==1)||(inp==2)||(inp==4)||(inp==7)) { printf("This is Kongming's Trap!!!\n"); continue; } int a,b,k; if(inp%3==0){a=inp/3;b=0;} if(inp%3==1){a=(inp-10)/3;b=2;} if(inp%3==2){a=(inp-5)/3;b=1;} k=a/5; a-=5*k; b+=3*k; printf("%d\n",a+b); } return 0; }
沒有留言:
張貼留言