最終更新日時(UTC):
が更新

履歴 編集

function
<cstdio>

std::scanf

namespace std {
  int scanf(const char * format, ...);
}

概要

標準入力から、指定された書式文字列を使用してデータを入力する。

#include <cstdio>

int main() {
  int n;
  std::scanf("%d", &n);
  std::printf("%d\n", n);
}

出力(test.txtは以下参照)

123

ファイル内容(test.txt)

123

処理系