POJ 1006 Biorhythms

典型的 阅读理解题 , 读懂意思基本上思路就出来了,恰巧又是一道中文题,这里用枚举,其他不解释。


    
    
    
    
POJ 1006 Biorhythms - Icho - Brian Warehouse #include  < stdio.h >
POJ 1006 Biorhythms - Icho - Brian Warehouse
int  main()
POJ 1006 Biorhythms - Icho - Brian WarehousePOJ 1006 Biorhythms - Icho - Brian Warehouse
POJ 1006 Biorhythms - Icho - Brian Warehouse {
POJ 1006 Biorhythms - Icho - Brian Warehouse    
int i,a,b,c,d,days=0;
POJ 1006 Biorhythms - Icho - Brian Warehouse    
while(1)
POJ 1006 Biorhythms - Icho - Brian WarehousePOJ 1006 Biorhythms - Icho - Brian Warehouse    
POJ 1006 Biorhythms - Icho - Brian Warehouse{
POJ 1006 Biorhythms - Icho - Brian Warehouse        days
++;
POJ 1006 Biorhythms - Icho - Brian Warehouse        scanf(
"%d%d%d%d",&a,&b,&c,&d);
POJ 1006 Biorhythms - Icho - Brian Warehouse        
if (a+b+c+== -4break;
POJ 1006 Biorhythms - Icho - Brian Warehouse        
for (i=d+1; ; i++// pay attention: from d+1
POJ 1006 Biorhythms - Icho - Brian WarehousePOJ 1006 Biorhythms - Icho - Brian Warehouse
        POJ 1006 Biorhythms - Icho - Brian Warehouse{
POJ 1006 Biorhythms - Icho - Brian Warehouse            
if ((i-a)%23==0)
POJ 1006 Biorhythms - Icho - Brian Warehouse                
if ((i-b)%28==0)
POJ 1006 Biorhythms - Icho - Brian Warehouse                    
if ((i-c)%33==0)
POJ 1006 Biorhythms - Icho - Brian WarehousePOJ 1006 Biorhythms - Icho - Brian Warehouse                    
POJ 1006 Biorhythms - Icho - Brian Warehouse{
POJ 1006 Biorhythms - Icho - Brian Warehouse                        printf(
"Case %d: the next triple peak occurs in %ld days.\n",days,i-d);
POJ 1006 Biorhythms - Icho - Brian Warehouse                        
break;
POJ 1006 Biorhythms - Icho - Brian Warehouse                    }

POJ 1006 Biorhythms - Icho - Brian Warehouse        }

POJ 1006 Biorhythms - Icho - Brian Warehouse    }

POJ 1006 Biorhythms - Icho - Brian Warehouse    
return 0;
POJ 1006 Biorhythms - Icho - Brian Warehouse}

你可能感兴趣的:(POJ 1006 Biorhythms)