Java/2012.04 강좌

4일차 제어문 활용

Bohemian life 2012. 4. 6. 11:56
public class MultiFor {
	public static void main(String[] args){
		int total =0;
		for (int i=1; i<=100; i++){
			total = total +i;
			
			if(i% 10 ==0){
				System.out.println("1부터"+i+"까지의 합계는"+total);
			}
			
		}
	}

}