标签:bit its printf using else pac style clu mes
14
1 #include<bits/stdc++.h> 2 using namespace std; 3 int main(){ 4 char str[5][70]; 5 scanf("%s%s%s%s",str[0],str[1],str[2],str[3]); 6 int len=strlen(str[0]); 7 int len1=strlen(str[1]); 8 int len2=strlen(str[2]); 9 int len3=strlen(str[3]); 10 int pos; 11 char day; 12 char hh; 13 int mm; 14 for(int i=0;i<len;i++){ 15 if(str[0][i]>=‘A‘&&str[0][i]<=‘G‘){ 16 if(str[0][i]==str[1][i]){ 17 day=str[0][i]; 18 pos=i; 19 break; 20 } 21 } 22 } 23 for(int i=pos+1;i<len;i++){ 24 if(str[0][i]>=‘A‘&&str[0][i]<=‘N‘||str[0][i]>=‘0‘&&str[0][i]<=‘9‘){ 25 if(str[0][i]==str[1][i]){ 26 hh=str[0][i]; 27 break; 28 } 29 } 30 } 31 for(int i=0;i<len2;i++){ 32 if(str[0][i]>=‘A‘&&str[0][i]<=‘Z‘||str[0][i]>=‘a‘&&str[0][i]<=‘z‘){ 33 if(str[2][i]==str[3][i]){ 34 mm=i; 35 break; 36 } 37 } 38 } 39 cout<<day<<hh<<mm; 40 char a[10][5]={"MON","TUE","WED","THU","FRI","SAT","SUN"} ; 41 printf("%s ",a[(int)day-65]); 42 if(hh>=‘A‘&&hh<=‘N‘) printf("%d:",(int)hh-55); 43 else printf("0%c:",hh); 44 printf("%02d",mm); 45 }
标签:bit its printf using else pac style clu mes
原文地址:https://www.cnblogs.com/taiga/p/12670596.html