首页 > 代码库 > PAT Basic Level 1010

PAT Basic Level 1010

 1 #include <stdio.h>
 2 int main ()
 3 {
 4     int coe;
 5     int exp;
 6     int flag = 1;
 7     while(scanf("%d %d",&coe,&exp) == 2)    //这一条语句好好想想 
 8     {
 9         if(exp != 0 )
10         {
11     
12             if(flag == 1)
13             {
14                 printf("%d %d",coe * exp,exp - 1);
15                 flag = 0;
16             }
17             else
18             {
19                 printf(" %d %d",coe * exp,exp - 1);
20             }
21         }
22         
23     }
24     if (flag)
25     {
26         printf("%d %d",0,0); 
27     }
28     return 0;
29  } 
30  
31 
32        

 

PAT Basic Level 1010