/*
import java.util.Iterator;
import java.util.Vector;
public class Main {
public static void main(String[] args) {
Vector<Integer> v = new Vector<Integer>();
v.add(5);
v.add(4);
v.add(-1);
v.add(2, 100);
Iterator <Integer> it = v.iterator();
while(it.hasNext()) {
int n=it.next();
System.out.println(n);
}
it= v.iterator();
int sum = 0;
while(it.hasNext()) {
int n= it.next();
sum += n;
}
System.out.println("백터에 있는 정수 합:"+sum);
}
}
/*
import java.util.Vector;
class Point{
private int x,y;
public Point(int x, int y) {
this.x =x; this.y =y;
}
public String toString() {
return "(" + x + "," + y + ")";
}
}
public class Main{
public static void main(String[] args) {
Vector<Point> v= new Vector<Point>();
v.add(new Point(2,3));
v.add(new Point(-5,20));
v.add(new Point(30,-8));
v.remove(1);
for(int i=0; i<v.size(); i++) {
Point p = v.get(i);
System.out.println(p);
}
}
}
*/
/*
import java.util.*;
public class Main{
public static void main(String[] args) {
ArrayList<String> a = new ArrayList<String>();
Scanner sc = new Scanner(System.in);
for(int i=0;i<4;i++) {
System.out.println("이름을 입력하래요 >>");
String s = sc.next();
a.add(s);
}
for(int i=0; i<a.size(); i++) {
String name = a.get(i);
System.out.println(name + " ");
}
int longestIndex = 0 ;
for(int i=1; i<a.size();i++) {
if(a.get(longestIndex).length() < a.get(i).length());
longestIndex = i;
}
System.out.println("\n가장 long한 이름은 " + a.get(longestIndex));
}
}
*/
import java.util.*;
public class Main{
public static int getAvg(Vector<Integer> v) {
int sum=0;
Iterator<Integer> it = v.iterator();
while(it.hasNext()) {
int n = it.next();
sum+= n;
System.out.println(n);
}
return sum/v.size();
}
public static void main(String[] args) {
Vector <Integer> v = new Vector<Integer>(1);
Scanner sc = new Scanner(System.in);
while(true) {
System.out.print("강수량 입력 >>");
int s = sc.nextInt();
if(s==0) break;
v.add(s);
System.out.println("현재 평균 "+getAvg(v));
}
}
}



