2013 ACM/ICPC Asia Regional Changsha Online - E

时间:2023-03-08 16:03:00
2013 ACM/ICPC Asia Regional Changsha Online - E

第一个被板刷的题

取余 依次算在周几

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdlib.h>
#include<cmath>
#include<map>
using namespace std;
double ll,ss;
char we[];
char s[][] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
int main()
{
int k,y,o,i;
while(cin>>we>>ll>>ss)
{
double kk = ll/ss;
for(i = ; i < ; i++)
if(strcmp(we,s[i])==)
{
y = i;
break;
}
k = ll/ss;
if(kk!=k)
k++;
if(y<=)
k+=y*;
else
k += *+(y-)*;
o = *+;
k = k%o;
if(k==)
k = ;
if(k<=)
printf("%s\n",s[]);
else if(k>&&k<=)
printf("%s\n",s[]);
else if(k>&&k<=)
printf("%s\n",s[]);
else if(k>&&k<=)
printf("%s\n",s[]);
else if(k>&&k<=)
printf("%s\n",s[]);
else if(k>&&k<=)
printf("%s\n",s[]);
else
printf("%s\n",s[]);
}
return ;
}