pat1061
来源:互联网 发布:pkpm软件下载 编辑:程序博客网 时间:2024/06/08 16:15
捣鼓了一天VS,终于写出了一道题T_T
#include<iostream>#include<string>#include<cstdio>using namespace std;string week[] = {"MON","TUE","WED","THU","FRI","SAT","SUN"};int main(){//freopen("C://Users//Yuanyin//Desktop//in.txt","r",stdin);//freopen("C://Users//Yuanyin//Desktop//out.txt","w",stdout);string str1,str2,str3,str4,day = "";char ch1,ch2;int flag = 0;cin>>str1>>str2>>str3>>str4;int i = 0;int l1 = str1.size(), l2 = str2.size();while(i < l1 && i < l2){if(str1[i] == str2[i]){ch1 = str1[i];if(ch1 >= 'A' && ch1 <= 'G'){break;}}i++;}cout<<week[ch1 - 'A'];i++;while(i < l1 && i < l2){if(str1[i] == str2[i]){ch1 = str1[i];if((ch1 >= '0' && ch1 <= '9') || ( ch1 >= 'A' && ch1 <= 'N')){break;}}i++;}int hour = 0;if(ch1 >= '0' && ch1 <= '9'){hour = ch1 - '0';cout<<" 0"<<hour;}else{hour = 10 + (ch1 - 'A');cout<<" "<<hour;}i = 0; l1 = str3.size();l2 = str4.size();while(i < l1 && i < l2){if(str3[i] == str4[i]){ch1 = str3[i];if((ch1 >= 'a' && ch1 <= 'z') || ( ch1 >= 'A' && ch1 <= 'Z')){break;}}i++;}if(i < 10){cout<<":0"<<i<<endl;}else{cout<<":"<<i<<endl;}return 0;}
0 0
- pat1061
- pat1061
- PAT1061
- pat1061-1070
- PAT1061. 判断题(15)
- PAT1061 判断题
- PAT1061. 判断题
- PAT1061 判断题
- IO - 同步,异步,阻塞,非阻塞 (亡羊补牢篇)
- cocosdx让AppDelegate支持全局更新机制
- Ubuntu笔记--文件关联软件
- iOS——加载进度示的SVProgressHUD 用法
- npm
- pat1061
- 两种高性能 I/O 设计模式 Reactor 和 Proactor
- leetcode Longest Substring Without Repeating Characters
- How to install SVN server with USVN, Apache, mod_dav_svn on CentOS 6
- 删除之后在原页面显示删除
- quick lua-binding使用详解
- HTTP协议(二):header标头说明
- 适配器模式
- TCP协议和socket API 学习笔记