没啥好说的,直接贴代码
#include <stdio.h>
#include <math.h>
int main ()
{
int T, i;
int h[4];//五位学长的身高
int level;//学姐等级
int darklight;//有无 黑照
double lightcnt;//学姐有几道光线
int kill;//竜死了几个学长
scanf("%d",&T);
while (T--){
scanf("%d %d", &level, &darklight);
scanf("%d %d %d %d %d", &h[0], &h[1], &h[2], &h[3], &h[4]);
kill = 0;
if ( level < 6 ){//通过等级 确定光线数量
printf("none");
} else if ( level < 11 ){
if ( darklight ) lightcnt = 5;
else lightcnt = 4;
} else if ( level < 16 ){
if ( darklight ) lightcnt = 8;
else lightcnt = 7;
} else {
if ( darklight ) lightcnt = 12;
else lightcnt = 10;
}
//开始屠杀学长
for ( i = 0;i < 5 && lightcnt > 0 && lightcnt * 300 > h[i];i++){
lightcnt -= ceil( h[i] / 300.0 );
kill += 1;
}
switch ( kill ){
case 1: printf("first blood\n"); break;
case 2: printf("double kill\n"); break;
case 3: printf("triple kill\n"); break;
case 4: printf("ultra kill\n"); break;
case 5: printf("rampage\n"); break;
default:printf("none\n"); break;
}
printf("\n");
}
return 0;
}