| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
各位问问这道题为什么不能打表过啊????
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int n;
char s[10];
while(~scanf("%d",&n))
{
while(n--)
{
scanf("%s",s);
if(strcmp(s,"1:00")==0)
printf("13\n");
else if(strcmp(s,"2:00")==0)
printf("14\n");
else if(strcmp(s,"3:00")==0)
printf("15\n");
else if(strcmp(s,"4:00")==0)
printf("16\n");
else if(strcmp(s,"5:00")==0)
printf("17\n");
else if(strcmp(s,"6:00")==0)
printf("18\n");
else if(strcmp(s,"7:00")==0)
printf("19\n");
else if(strcmp(s,"8:00")==0)
printf("20\n");
else if(strcmp(s,"9:00")==0)
printf("21\n");
else if(strcmp(s,"10:00")==0)
printf("22\n");
else if(strcmp(s,"11:00")==0)
printf("23\n");
else if(strcmp(s,"12:00")==0)
printf("24\n");
else if(strcmp(s,"13:00")==0)
printf("1\n");
else if(strcmp(s,"14:00")==0)
printf("2\n");
else if(strcmp(s,"15:00")==0)
printf("3\n");
else if(strcmp(s,"16:00")==0)
printf("4\n");
else if(strcmp(s,"17:00")==0)
printf("5\n");
else if(strcmp(s,"18:00")==0)
printf("6\n");
else if(strcmp(s,"19:00")==0)
printf("7\n");
else if(strcmp(s,"20:00")==0)
printf("8\n");
else if(strcmp(s,"21:00")==0)
printf("9\n");
else if(strcmp(s,"22:00")==0)
printf("10\n");
else if(strcmp(s,"23:00")==0)
printf("11\n");
else if(strcmp(s,"24:00")==0)
printf("12\n");
else if(strcmp(s,"00:00")==0)
printf("12\n");
else
printf("0\n");
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator