백준 #4696번 St.lves

jhj·2024년 2월 9일

백준 JAVA

목록 보기
160/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		double n = sc.nextDouble();
		double total;
		
		while(n != 0) {
			total = 0;
			total += n;
			total += n * n;
			total += n * n * n;
			total += n * n * n * n;
			total += 1;
			System.out.println(String.format("%.2f", total));
			n = sc.nextDouble();
		}
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글