為什么無(wú)法通過(guò)胜蛉?
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<cctype>
using namespace std;
int main()
{
map<char, string> weak = { {'A',"MON"},{'B',"TUE"},{'C',"WED"},{'D',"THU"},{'E',"FRI"},{'F',"SAT"},{'G',"SUN" } };
map<char, string> hour = { {'0',"00"}, {'1',"01"},{'2',"02"},{'3',"03"},{'4',"04"},{'5',"05"},{'6',"06"},{'7',"07"},{'8',"08"},{'9',"09"},{'A',"10"},{'B',"11"},{'C',"12"},{'D',"13"},{'E',"14"},{'F',"15"},{'G',"16"},{'H',"17"},{'I',"18"},{'J',"19"},{'K',"20"},{'M',"21"},{'L',"22"},{'N',"23"} };
string d1, d2;
string t1, t2;
cin >> d1 >> d2 >> t1 >> t2;
vector<char> vec_d;
for (string::size_type sz = 0; sz < min(d1.size(), d2.size()); ++sz)
{
if(d1[sz]==d2[sz] && isalpha(d1[sz]))
vec_d.push_back(d1[sz]);
}
vector<int> vec_m;
for (string::size_type sz = 0; sz < min(t1.size(), t2.size()); ++sz)
{
if(t1[sz]==t2[sz] && isalpha(t1[sz]))
vec_m.push_back(sz);
}
string out_m;
if (vec_m[0]<10)
{
out_m = string("0") + to_string(vec_m[0]);
}
else
{
out_m = to_string(vec_m[0]);
}
string out;
out = weak.at(vec_d[0]) + string(" ") + hour.at(vec_d[1]) + string(":") +out_m;
cout << out;
system("pause");
return 0;
}