标签:
1 #include<stdio.h>//盗梦空间(125) 2 #include<string.h> 3 int main() 4 { 5 int x,y,t=1; 6 char s[10]; 7 double m,res=0.0; 8 scanf("%d",&x); 9 while(x--){ 10 scanf("%d",&y); 11 while(y--){ 12 memset(s,0,sizeof(s)); 13 scanf("%s",&s); 14 if(strcmp(s,"IN")==0)t*=20; 15 if(strcmp(s,"STAY")==0){ 16 scanf("%lf",&m); 17 res=res+m/t; 18 } 19 if(strcmp(s,"OUT")==0)t/=20; 20 } 21 printf("%g\n",res*60); 22 res=0;t=1; 23 } 24 return 0; 25 }
标签:
原文地址:http://www.cnblogs.com/minimalism/p/4537635.html