AcWing 5178. 竖琴调音
原题链接
简单
作者:
D.Russell
,
2024-11-30 21:05:59
,
所有人可见
,
阅读 4
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
string str;
cin >> str;
for (int i = 0; i < str.size(); ) {
string String, op, num;
while (str[i] >= 'A' && str[i] <= 'T') {
String += str[i];
i ++;
}
op += str[i ++ ];
while (str[i] >= '0' && str[i] <= '9') {
num += str[i];
i ++;
}
cout << String << ' ';
if (op == "+") cout << "tighten" << ' ';
if (op == "-") cout << "loosen" << ' ';
cout << num << endl;
}
return 0;
}