题目链接
https://www.nowcoder.com/acm/contest/85/H
思路
如果熟悉 五线谱 才能做啊。。。
然后 先竖着遍历 再 横着 遍历 就可以了
AC代码
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <numeric>
#include <sstream>
#include <iomanip>
#include <limits>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
const double PI = 3.14159265358979323846264338327;
const double E = 2.718281828459;
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7;
int main()
{
map <int, char> m;
m[0] = 'F';
m[1] = 'E';
m[2] = 'D';
m[3] = 'C';
m[4] = 'B';
m[5] = 'A';
m[6] = 'G';
m[7] = 'F';
m[8] = 'E';
int n;
cin >> n;
getchar();
string s[9];
string ans = "";
for (int i = 0; i < 9; i++)
getline(cin, s[i]);
for (int i = 0; i < n; i++)
{
int flag = 0;
for (int j = 0; j < 9; j++)
{
if (flag)
{
if (s[j][i] != '|')
flag = 0;
else
continue;
}
if (s[j][i] == '|' && j == 0)
flag = 1;
else if (s[j][i] == 'o')
{
ans += m[j];
break;
}
}
if (flag)
ans += '|';
}
cout << ans << endl;
}