c++ - File input separation -
Currently, I am writing a program for a class, and we must use file input and output. He gave us a file, which is 8 separate sets of 7 numbers (all integers) we have to enter the user who wants to read it, and then the highest number, the least number, the sum of the set of numbers and the set The average of is produced. I have a problem asking XCode to read a line of numbers. I do not have much practice with the Any suggestions? This is a homework assignment, it is the efficiency to sacrifice that you find a certain subject, But the code should give you a vague idea. Note ** This works only when you can enter the user only one line and exits the program getline () function, even if it is a solution too.
cout & lt; & Lt; "Enter the row ..."; Cin & gt; & Gt; Line; // Error Check Line is within the limit / lines / Loop line (for loop) through 7 loops / loops through loops / // vars // end loop / // loop through array Array) for // loop) // sum array [i] on the amount // is this number higher than high? If so, set equal to element of higher array / / is it less than less variable? If so, set less equal to array element / end loop
Comments
Post a Comment