import java.lancs.BasicIo; public class sum_for { public static void main (String[] args) throws Exception { System.out.println (); System.out.print ("Specify a sequence of integers, "); System.out.print ("where the first integer specifies how many more integers will follow"); System.out.println (); System.out.println (); int total = 0; int iterations = BasicIo.readInteger (); for (int i = 0; i < iterations; i++) { int current_value = BasicIo.readInteger (); total += current_value; } System.out.println (); System.out.println ("The total of " + iterations + " number(s) is: " + total); System.out.println (); } }