Input problem

The inputs are numbers in just a input line. The number of numbers in the line increasing by 1 every line of input. So how can I assign them to an array or something like that (like vector).

P.s: Solving this problem: http://www.codechef.com/problems/SUMTRIAN
You could use a vector of vectors of ints std::vector<std::vector<int>>.

Add each number you read to a vector. When you have read the whole line you add the vector to another vector. At the end you will have a vector containing a vector of ints for each line in the file.
Last edited on
Nevermind, I've got it. Sorry.
Topic archived. No new replies allowed.