'commit'
This commit is contained in:
25
TangDou/LanQiaoBei/LanQiao14STEMA202212/2_2.cpp
Normal file
25
TangDou/LanQiaoBei/LanQiao14STEMA202212/2_2.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
const int N = 110;
|
||||
string s;
|
||||
/*
|
||||
WMWM
|
||||
|
||||
答案:
|
||||
WWWW
|
||||
*/
|
||||
// WMWM
|
||||
int main() {
|
||||
cin >> s;
|
||||
for (int i = 0; i < s.size(); i++) {
|
||||
if (i % 2 == 1) {
|
||||
if (s[i] == 'W')
|
||||
cout << 'M';
|
||||
else
|
||||
cout << 'W';
|
||||
} else
|
||||
cout << s[i];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user