国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

PAT A1061. Dating (20)

2019-11-11 03:09:42
字體:
來源:轉載
供稿:網友

Sherlock Holmes received a note with some strange strings: "Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm". It took him only a minute to figure out that those strange strings are actually referring to the coded time "Thursday 14:04" -- since the first common capital English letter (case sensitive) shared by the first two strings is the 4th capital letter 'D', rePResenting the 4th day in a week; the second common character is the 5th capital letter 'E', representing the 14th hour (hence the hours from 0 to 23 in a day are represented by the numbers from 0 to 9 and the capital letters from A to N, respectively); and the English letter shared by the last two strings is 's' at the 4th position, representing the 4th minute. Now given two pairs of strings, you are supposed to help Sherlock decode the dating time.

Input Specification:

Each input file contains one test case. Each case gives 4 non-empty strings of no more than 60 characters without white space in 4 lines.

Output Specification:

For each test case, print the decoded time in one line, in the format "DAY HH:MM", where "DAY" is a 3-character abbreviation for the days in a week -- that is, "MON" for Monday, "TUE" for Tuesday, "WED" for Wednesday, "THU" for Thursday, "FRI" for Friday, "SAT" for Saturday, and "SUN" for Sunday. It is guaranteed that the result is unique for each case.

Sample Input:
3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&HyscvnmSample Output:
THU 14:04
#include <cstdio>#include <algorithm>#include <cmath>#include <cstring>#define Max 100using namespace std;int getl(int a,int b){	if(a>b) return b;	else return a;}int main(){	char a[Max],b[Max],c[Max],d[Max];	char D[8][8]={"MON","TUE","WED","THU","FRI","SAT","SUN"};	char S[25][8]={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"};	scanf("%s",a);	scanf("%s",b);	scanf("%s",c);	scanf("%s",d);	int f=0,l1,l2;	l1=getl(strlen(a),strlen(b));	l2=getl(strlen(c),strlen(d));	for(int i=0;i<l1;i++)	{		if(f==0)		{			if(a[i]>='A'&&a[i]<='G')			{				if(b[i]==a[i]){				printf("%s ",D[a[i]-'A']);				f=1;				}			}		}		else {			if(a[i]>='0'&&a[i]<='9')			{				if(b[i]==a[i])				{					printf("%s:",S[a[i]-'0']);					break;				}			}			else if(a[i]>='A'&&a[i]<='N')			{				if(b[i]==a[i])				{					printf("%s:",S[a[i]-'A'+10]);					break;				}			}		}	}	for(int i=0;i<l2;i++)	{		if((c[i]>='a'&&c[i]<='z')||(c[i]>='A'&&c[i]<='Z')){		if(c[i]==d[i])		{								printf("%02d/n",i);					break;					}		}	}	system("pause");	return 0;}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 启东市| 黄大仙区| 静安区| 越西县| 黄冈市| 罗城| 依安县| 富平县| 乌审旗| 乡宁县| 东台市| 醴陵市| 桃源县| 淮滨县| 大余县| 综艺| 兴海县| 南阳市| 外汇| 宝兴县| 郎溪县| 台江县| 阿拉善右旗| 三门县| 班戈县| 门头沟区| 垣曲县| 义马市| 九寨沟县| 满洲里市| 昭平县| 怀化市| 阳西县| 噶尔县| 陕西省| 武义县| 克拉玛依市| 千阳县| 丰镇市| 伊川县| 东兰县|