简单模拟。

#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)的更多相关文章

  1. PAT (Advanced Level) 1077. Kuchiguse (20)

    最长公共后缀.暴力. #include<cstdio> #include<cstring> #include<cmath> #include<vector&g ...

  2. PAT (Advanced Level) 1008. Elevator (20)

    简单模拟. 注意a[i]==a[i-1]的情况. #include<iostream> #include<cstring> #include<cmath> #inc ...

  3. PAT (Advanced Level) 1035. Password (20)

    简单题. #include<iostream> #include<cstring> #include<cmath> #include<algorithm> ...

  4. PTA(Basic Level)1014.福尔摩斯的约会 && PTA(Advanced Level)1061.Dating

    大侦探福尔摩斯接到一张奇怪的字条:我们约会吧! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm.大侦探很快就明白了,字条上奇 ...

  5. 【PAT甲级】1061 Dating (20 分)

    题意: 给出四组字符串,前两串中第一个位置相同且大小相等的大写字母(A~G)代表了周几,前两串中第二个位置相同且大小相等的大写字母或者数字(0~9,A~N)代表了几点,后两串中第一个位置相同且大小相等 ...

  6. PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642 题目描述: The task is really simple: ...

  7. PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642 题目描述: Shuffling is a procedure us ...

  8. 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 ...

  9. PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642 题目描述: To prepare for PAT, the judge someti ...

随机推荐

  1. OpenCV使用边缘提取、腐蚀、轮廓进行车牌定位

    http://blog.csdn.net/superdont/article/details/24935383 OpenCV使用边缘提取.腐蚀.轮廓进行车牌定位 2014-05-03 21:38 67 ...

  2. hdu_5742_It's All In The Mind

    题目链接:hdu_5742_It's All In The Mind 题意: 有一个部分的数列,让你找一个满足他给的三个条件的数列,使前两个数的和除这个数列的sum最大 题解: xjb贪心一下就行了. ...

  3. E212:无法打开并写入文件

    用vi编辑文件是  老师出现这样的错误 有些文件   需要root权限才能修改   切换成root权限就行了

  4. 外部连VPN的方法

    1)安装网络挂件vpnc使用命令:sudo apt-get install vpnc 2)找到公司的默认配置文件xxx_common.pcf ,使用命令将其转换为对应的配置文件:sudo pcf2vp ...

  5. Gym 100917L Liesbeth and the String 规律&&胡搞

    题目: Description standard input/outputStatements Little Liesbeth likes to play with strings. Initiall ...

  6. 修改apache配置文件去除thinkphp url中的index.php

    例如你的原路径是 http://localhost/test/index.php/index/add那么现在的地址是 http://localhost/test/index/add如何去掉index. ...

  7. linux通用邻居基础架构

    1.为每一个协议提供一个缓存来存放L3到L2的转换结果. 2.提供在缓存中添加.删除.改变和查找一个特定映射项的函数.查找函数必须要快,因为它会影响整个系统的性能. 3.为每一个协议缓存的数据项提供一 ...

  8. CDockablepane风格设置

    屏蔽掉pane右上角的几个按钮 即将CDockablePane右上角的三个按钮屏蔽. 1            去掉关闭按钮 在CDockablePane的派生类中,重写方法CanBeClosed即可 ...

  9. BinTools 十六进制转换

    package de.rtner.misc; public class BinTools { public static final String hex = "0123456789ABCD ...

  10. java 继承与多态

    Example5_11.java class 动物 { void cry() { } } class 狗 extends 动物 { void cry() { System.out.println(&q ...