結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
ldsyb
|
| 提出日時 | 2016-03-08 15:59:05 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 541 bytes |
| コンパイル時間 | 706 ms |
| コンパイル使用メモリ | 59,744 KB |
| 実行使用メモリ | 25,832 KB |
| 平均クエリ数 | 101.00 |
| 最終ジャッジ日時 | 2024-07-16 08:47:15 |
| 合計ジャッジ時間 | 3,816 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:18: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘std::string*’ {aka ‘std::__cxx11::basic_string<char>*’} [-Wformat=]
17 | scanf("%s",&trash);
| ~^ ~~~~~~
| | |
| | std::string* {aka std::__cxx11::basic_string<char>*}
| char*
main.cpp:16:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d",&match);
| ~~~~~^~~~~~~~~~~~~
main.cpp:17:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
17 | scanf("%s",&trash);
| ~~~~~^~~~~~~~~~~~~
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
int main(){
string trash;
int num[10] = {};
for(int i = 0;i < 10;i++){
int match = 0;
for(int j = 0;j < 10;j++){
for(int k = 0;k < 10;k++){
if(i == k) cout << j;
else cout << 'x';
}
cout << endl;
scanf("%d",&match);
scanf("%s",&trash);
if(match == 1){
num[i] = j;
break;
}
}
}
for(int i = 0;i < 10;i++) cout << num[i];
cout << endl;
}
ldsyb