結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2017-03-10 22:00:24 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 531 bytes |
コンパイル時間 | 442 ms |
コンパイル使用メモリ | 54,580 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 04:17:11 |
合計ジャッジ時間 | 1,359 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
外部呼び出し有り |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:28:15: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 28 | system("pause"); | ~~~~~~^~~~~~~~~
ソースコード
#include <iostream>using namespace std;int main() {char a[100];bool b = false;for (int i = 0; i < 100; i++) {cin >> a[i];if (a[i] != 'O'&&a[i] != 'X')break;}for (int i = 0; i < 100; i++) {if (a[i] == 'O') {if (a[i + 1] == 'O'&&a[i + 2] == 'O') {cout << "East" << endl;b = true;break;}}if (a[i] == 'X') {if (a[i + 1] == 'X'&&a[i + 2] == 'X') {cout << "West" << endl;b = true;break;}}}if (b == false)cout << "NA" << endl;system("pause");return 0;}