結果

問題 No.539 インクリメント
ユーザー RIGIHRIGIH
提出日時 2017-07-04 03:05:13
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 463 bytes
コンパイル時間 774 ms
コンパイル使用メモリ 70,176 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 14:59:04
合計ジャッジ時間 2,313 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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]);
      |                 ~~~~~^~~~~~~~~~~~~

ソースコード

diff #

#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;


}
0