0分!
查看原帖
0分!
1070431
ywtank楼主2024/9/16 08:05
#include <bits/stdc++.h>
using namespace std;
int x=0,y=0;
int main(){
	string ss;
	cin >> ss;
	int t;
	cin >> t;
	while(t>0){
		for(int i=0;i<ss.size() && t>0;i++,t--){
			if(ss[i]=='W')x--;
			else if(ss[i]=='E')x++;
			else if(ss[i]=='N')y--;
			else y++;
		}
	}
	cout << x << ' ' << y;
	return 0;
}

希望各位大佬帮忙看看

2024/9/16 08:05
加载中...