本机没问题,为啥洛谷评测就RE了呢?
查看原帖
本机没问题,为啥洛谷评测就RE了呢?
304722
HarryPotterJames楼主2021/8/2 16:45
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string a,b,ans;
    a=b=ans="";
    int tl=0,sum=0,i;
    
    for(i=0;i<62;i++)
    {
        getline(cin,ans);
		
        int j;
        for(j=0;j<ans.size()&&ans[j+1]!=',';j++)
            a[j]=ans[j];
        j+=2; 
        for(;ans[j+1];j++)
            b[j]=ans[j];
        if(a=="Sweep the floor"||a=="Clean the table") tl+=20;
        else if(a=="Clean the windows") tl+=15;
        else if(a=="Cook the meal") tl+=25;
        else if(a=="Wash the car") tl+=35;
        else if(a=="Get the mail") tl+=10;
        if(b=="Sweep the floor"||b=="Clean the table") tl+=20;
        else if(b=="Clean the windows") tl+=15;
        else if(b=="Cook the meal") tl+=25;
        else if(b=="Wash the car") tl+=35;
        else if(b=="Get the mail") tl+=10;
        if(tl>60) sum++;
    }
    
    cout<<sum<<endl;
    return 0;
}
2021/8/2 16:45
加载中...