topcoderにおけるC++の標準入力読み込み

競技プログラミングをやっていると標準入力から1行ずつ読み込んで処理をする場合が 出てくる。要素の数が決まっている場合はcinで対応出来るが、そうでない場合が多い。 例(要素の数が決まっている場合) #include <iostream> using namespace std; int main(){ int n, m; cin >> n >> m; cout << "first elem is " << n << " second </iostream>…