피보나치 수열
public class PibonacciTest {
public static void main(String[] args) {
// 1+(1+2)+(1+2+3)+(1+2+3+4)
int count =0;
int i = 1;
int total = 0;
int sum = 0;
System.out.println("Pibonacci 값 : ");
for(i=1;i<10;i++){
System.out.print(i+" ");
total += i;
System.out.println(total+" ");
count++;
sum += total;
}
System.out.println("행수 : "+count);
System.out.println("피보나치 수열 총합 : "+sum);
}
}