50pts,求条必关
查看原帖
50pts,求条必关
1002763
Fusiyu666楼主2025/7/29 22:04
#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;

int main()
{
    int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
    char ch;
    while (1)
    {
        cin >> ch;
        if (ch == 'E')
        {
            break;
        }
        if(ch=='W')
        {
            x1++;
            x2++;
        }
        else
        {
            y1++;
            y2++;
        }
        if(x1+y1==11)
        {
            cout << x1 << ":" << y1 << endl;
            x1 = 0;
            y1 = 0;
        }
        if(x2+y2==21)
        {
            v.push_back({x2, y2});
            x2 = 0;
            y2 = 0;
        }
    }
    cout << x1 << ":" << y1 << endl << endl;
    for(auto i:v)
    {
        cout << i.first << ":" << i.second << endl;
    }
    cout << x2 << ":" << y2 << endl;
    return 0;
}

有调必关 有调必关 有调必关!!!

2025/7/29 22:04
加载中...