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 ...
随机推荐
- Broken Keyboard(悲剧文本)
你有一个键盘,键盘上所有的键都能正常使用,只是Home键和End键有时会自动按下.你并不知道这一情况,而是专心地打稿子,甚至连显示器都没开电源.当你打开显示器之后,展现在你面前的是一段悲剧文本.你的任 ...
- LeetCode OJ 292.Nim Game
You are playing the following Nim Game with your friend: There is a heap of stones on the table, eac ...
- ios控件 UIControl
< UIControl> 1 处理用户事件的控件的基类,如UIButton,UISlider等 2 一般不直接实例化,而是使用他的子类 3 可以通过跟踪触摸事件来设置和获取控件状态,并且这 ...
- 07-09 07:28:38.350: E/AndroidRuntime(1437): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.googleplay.ui.activity.MainActivity" on path: DexPathList[[zip file "/data/app/c
一运行,加载mainActivity就报错 布局文件乱写一通,然后急着运行,报莫名其妙的错误: 07-09 07:28:38.350: E/AndroidRuntime(1437): Caused b ...
- Linux文件系统中硬链接和软链接的区别 (转)
建立硬链接命令:ln src-link dest-link建立软链接:ln -s src-link dest-link 1. 硬链接是别名,软链接是快捷方式 2. 硬链接和源链接指向同一个i节 ...
- Windows平台查看端口占用情况
1.查看所有的端口占用情况 netstat -ano 协议 本地地址 外部地址 状态 PI ...
- SCP测试服务器的上行/下行带宽
SCP测试服务器的上行/下行带宽,这个咋弄呢?有时间再研究一下.
- ORA-12170: TNS:Connect timeout occurred
VM 作为ORACLE 服务器,客户端登陆提示超时,本地连接使用网络连接正常. D:>sqlplus system/oracle123@//192.168.63.121:15021/pdb01 ...
- C++调用C#之C# COM控件
C#做界面真的是比C++方便多了,所以尝试了一下,使用C++做核心功能(例如绘图),然后用C#来做节目(例如对话框),考虑到以后可能不能使用.net,使用DLL做一个隔离层,隔离C++和C#,方便以后 ...
- Hibernate的dynamic-insert和dynamic-update的使用
Hibernate在初始化的时候,默认按照配置为表预定义insert,delete,update,select(by id)的SQL语句放在session中,其中insert,update,selec ...