結果
| 問題 |
No.539 インクリメント
|
| コンテスト | |
| ユーザー |
RIGIH
|
| 提出日時 | 2017-07-04 03:05:13 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 463 bytes |
| コンパイル時間 | 749 ms |
| コンパイル使用メモリ | 69,924 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-05 13:15:15 |
| 合計ジャッジ時間 | 2,181 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:19:25: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type’ {aka ‘std::vector<char>’} [-Wformat=]
19 | scanf("%s",arr[i]);
| ~^
| |
| char*
main.cpp:22:26: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type’ {aka ‘std::vector<char>’} [-Wformat=]
22 | printf("%s\n",arr[i]);
| ~^
| |
| char*
main.cpp:19:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
19 | scanf("%s",arr[i]);
| ~~~~~^~~~~~~~~~~~~
ソースコード
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
using namespace std;
int main(){
int n;
cin>>n;
vector< vector<char> > arr;
arr.resize(n); // ()内の数字が要素数になる
for( int i=0; i<n; i++ ){
arr[i].resize(100010);
scanf("%s",arr[i]);
}
rep(i,n){
printf("%s\n",arr[i]);
}
return 0;
}
RIGIH