#include<iostream> using namespace std; #include<string> #include<vector> #include<math.h> string str = ""; string str_min = ""; string str_max = ""; long int liuliang[10000]; void  chuli(string str1,string str5) {     int j;     for(j = 6; j <=9;j++)         str +=str1[j];     for(j = 0; j <= 1;j++)         str += str1[j];     for(j = 3 ; j <= 4; j++)         str += str1[j];     for(j = 0; j <= 1; j++)         str += str5[j];     for(j = 3; j <= 4;j++)         str += str5[j];     for(j = 6; j <= 7; j++)         str += str5[j]; } void chuli1(string str3,string str6,string str7,string str8) {     int j;     for(j = 6; j <=9; j ++)         str_min +=str3[j];     for(j = 0; j  <=1 ; j++)         str_min += str3[j];     for(j = 3 ; j <= 4; j ++)         str_min += str3[j];     for( j = 0; j <= 1 ; j++)         str_min += str6[j];     for(j = 3; j <= 4; j ++)         str_min += str6[j];     for(j = 6; j <= 7; j ++)         str_min += str6[j];     for(j = 6; j <= 9; j ++)         str_max += str7[j];     for(j = 0; j <= 1; j ++)         str_max += str7[j];     for(j = 3;j <= 4; j ++)         str_max += str7[j];     for(j = 0; j <= 1;j++)         str_max += str8[j];     for(j = 3; j <= 4; j++)         str_max += str8[j];     for(j = 6; j <= 7;j++)         str_max += str8[j];      }           int main() {     long int n;     cin >> n;     long int i ;     long int num = 0;     string str2;     string str_10,str_20,str_30,str_40;     vector<string> v;     int result = 0;     for(i = 0 ; i < n ; i ++)     {         cin >> str2;         cin >> str_10;         cin >> num;         chuli(str2,str_10);         v.push_back(str);     //    cout << str;         liuliang[i] = num;         str = "";         num = 0;     }     int m;     cin >> m;     int j;     for(i = 0 ; i < m ; i ++)     {         cin >> str_10;         cin >> str_20;         cin >> str_30;         cin >> str_40;         chuli1(str_10,str_20,str_30,str_40);     //    cout << str_max << endl; //        cout << endl; //        cout << str_min << endl; //        cout << str_max;         for(j = 0 ; j < n;j++)         {             if((str_min <= v[j])&&(str_max >= v[j]))             {                 result += liuliang[j];             //    cout << 444444 << endl;             }         }         cout << result << endl;         result = 0;         str_min = "";         str_max = "";              }     return 0;           } 刚刚笔试的时候把月/日/年写成了日/月/年。。。好心塞,难怪一直是0%了,现在把日月年改过来了,运行例子是正确的。
点赞 评论

相关推荐

12-02 20:08
已编辑
门头沟学院 后端工程师
notbeentak...:孩子,说实话,选择很重要,可能你换一个方向会好很多,但是现在时间不太够了,除非准备春招
点赞 评论 收藏
分享
gelmanspar...:奖学金删掉,自我评价删掉,简历压缩一下,写一页
如果再来一次,你还会学机...
点赞 评论 收藏
分享
12-03 21:22
武汉大学 Java
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务