PAT (Advanced Level) 1061. Dating (20)
简单模拟。
#include<stdio.h>
#include<string.h> char s1[],s2[],s3[],s4[];
char f[][]={"MON ", "TUE ","WED ","THU ","FRI ","SAT ","SUN "};
int a,b,c,flag; int main()
{
scanf("%s%s%s%s",s1,s2,s3,s4); flag=;
for(int i=;s1[i]&&s2[i];i++) {
if(s1[i]!=s2[i]) continue;
if(flag==) {if(s1[i]>='A'&&s1[i]<='G') a=s1[i]-'A'+,flag=;}
else if(flag==){
if(s1[i]>=''&&s2[i]<='') b=s1[i]-'',flag=;
else if(s1[i]>='A'&&s2[i]<='N') b=s1[i]-'A'+,flag=;
}
}
for(int i=;s3[i]&&s4[i];i++){
if(s3[i]==s4[i]&&(s3[i]>='a'&&s3[i]<='z')||(s3[i]>='A'&&s3[i]<='Z')) {
c=i;break;
}
}
printf("%s%02d:%02d\n",f[a-],b,c);
return ;
}
PAT (Advanced Level) 1061. Dating (20)的更多相关文章
- PAT (Advanced Level) 1077. Kuchiguse (20)
最长公共后缀.暴力. #include<cstdio> #include<cstring> #include<cmath> #include<vector&g ...
- PAT (Advanced Level) 1008. Elevator (20)
简单模拟. 注意a[i]==a[i-1]的情况. #include<iostream> #include<cstring> #include<cmath> #inc ...
- PAT (Advanced Level) 1035. Password (20)
简单题. #include<iostream> #include<cstring> #include<cmath> #include<algorithm> ...
- PTA(Basic Level)1014.福尔摩斯的约会 && PTA(Advanced Level)1061.Dating
大侦探福尔摩斯接到一张奇怪的字条:我们约会吧! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm.大侦探很快就明白了,字条上奇 ...
- 【PAT甲级】1061 Dating (20 分)
题意: 给出四组字符串,前两串中第一个位置相同且大小相等的大写字母(A~G)代表了周几,前两串中第二个位置相同且大小相等的大写字母或者数字(0~9,A~N)代表了几点,后两串中第一个位置相同且大小相等 ...
- PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642
PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642 题目描述: The task is really simple: ...
- PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642
PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642 题目描述: Shuffling is a procedure us ...
- PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642
PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642 题目描述: Being unique is so important to peo ...
- PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642
PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642 题目描述: To prepare for PAT, the judge someti ...
随机推荐
- H5的新应用-获取用户当前的地理坐标
------------------------------ <script type="text/javascript"> ...
- listview前几个item的图片怎么是空白的、listview更新了ui不起作用、在handler里更新了UI不起作用
不是不起作用,不信你可以在更新ui代码附近加输出的log,说明程序是跑到那里了.但是未达到我们的想要的效果. 我们知道在listview里更新UI,listview的适配器Adapter里有个getV ...
- frameset框架样式 加边框
<frameset rows="580,*" FRAMESPACING="3"> <frame noresize name="Top ...
- Linux 查硬件配置
一:查看cpu more /proc/cpuinfo | grep "model name" grep "model name" /proc/cpuinfo 如 ...
- 深入理解javascript执行上下文(Execution Context)
本文转自:http://blogread.cn/it/article/6178 在这篇文章中,将比较深入地阐述下执行上下文 - Javascript中最基础也是最重要的一个概念.相信读完这篇文章后,你 ...
- maven之pom
记录一下最近的pom的相关设置,plugin的官方地址配置:http://maven.apache.org/plugins/index.html 看了网上说了很多例子,有很多不清楚,看一下官方的,会有 ...
- linux配置使用外部smtp发送邮件
mail命令需要设定mail.rc(或nail.rc)文件, set from=user@domain.comset smtp=smtp.domain.comset smtp-auth-user=us ...
- error: invalid 'asm': invalid operand for code 'w'
google 出结果 http://stackoverflow.com/questions/15623609/including-curl-into-the-android-aosp ........ ...
- mysql 连接两列
以下划线符号,连接两列,作为查询结果: SELECT CONCAT(col_1,'_',col_2) FROM yourtable
- Jquery-获取勾选的checkbox的同级节点数量
// 获取勾选的标签值得上一个兄弟节点 var groups = []; $('input[name="group_name"]:checked').siblings(" ...