|
|
back to boardWA #2. Still everything is right. \\// Ошибка в тесте №2. Хотя всё и так правильно Here it is. \\ // Вот код. #include <iostream> using namespace std; int main() { int n; cin >> n; int arrint[n]; char arrchar[n]; for (int i = 0; i < n; i++) { cin >> arrchar[i] >> arrint[i]; if ((int(arrchar[i]>104)) || (int(arrchar[i]) < 97)) break; if ((arrint[i] < 1) || (arrint[i] > 8)) break; } for (int i = 0; i < n; i++) { if ((int(arrchar[i]) >= 99) && int(arrchar[i]) <= 102) { if ((arrint[i] >= 3) && (arrint[i] <= 6)) { cout << "8" << endl; } else if ((arrint[i] == 2) || (arrint[i] == 7)) { cout << "6" << endl; } else { cout << "4" << endl; } } else if ((int(arrchar[i] == 98)) || (int(arrchar[i] == 103))) { if (((arrint[i]) >= 3) && (arrint[i] <= 6)) { cout << "6" << endl; } else if ((arrint[i] == 2) || (arrint[i] == 7)) { cout << "4" << endl; } else { cout << "2" << endl; } } else { if (((arrint[i]) >= 3) && (arrint[i] <= 6)) { cout << "4" << endl; } else if (((arrint[i]) == 2) || (arrint[i] == 7)) { cout << "3" << endl; } else { cout << "2" << endl; } } } return 0; } |
|
|