1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VisualStudio競プロ用設定

Last updated at Posted at 2020-09-07

概要

Visual Studioを普段使用しているため競プロでも使用したいがテスト用の入力データをいちいちコピペするのが面倒くさい。
https://ideone.com/ のように既に入力用のボックスに書いておきプログラムを実行したら出力用のボックスに結果が表示されるやり方はないものかと思い設定を行った。

行った設定

1.プロジェクトを作成

まずは通常通り空のプロジェクトを作成する。
2020-08-26 (2).png

2.cppファイルを作成

メインコード用のソースファイルを追加する。

3.input, output用のテキストファイルを作成

プロジェクトフォルダ直下にinput.txtとoutput.txtを作成する。
プロジェクトフォルダの場所に飛ぶにはソリューションエクスプローラを右クリックして「エクスプローラでフォルダを開く」をクリックする。

4.標準入力、標準出力設定を行う

「プロジェクト」⇒「(プロジェクト名)のプロパティ」⇒「構成プロパティ」⇒「デバッグ」⇒「コマンド引数」の右をクリックして
「< input.txt > output.txt」と記入する。
2020-08-26 (13).png

あとは通常通りプログラムを書き、inputにテストデータを入れることで
outputに結果が出力されるようになる。
2020-08-26 (15).png

たぶんこれが一番楽だと思います。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?