Skip to content

Instantly share code, notes, and snippets.

@Naba0123
Created October 12, 2015 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Naba0123/557adc95d8a5a7fa9279 to your computer and use it in GitHub Desktop.
Save Naba0123/557adc95d8a5a7fa9279 to your computer and use it in GitHub Desktop.
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
String rs = "";
while ((rs = br.readLine()) != null) {
line += rs + "\n";
}
String[] str = line.split("\n");
int[] out = new int[7];
int i = Integer.parseInt(str[0]);
int j = 1;
while (i > j) {
out[0] += Integer.parseInt(str[j++]);
out[1] += Integer.parseInt(str[j++]);
out[2] += Integer.parseInt(str[j++]);
out[3] += Integer.parseInt(str[j++]);
out[4] += Integer.parseInt(str[j++]);
out[5] += Integer.parseInt(str[j++]);
out[6] += Integer.parseInt(str[j++]);
}
int k = 0;
while (k < 7) {
System.out.println(out[k++]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment