Skip to content

Commit

Permalink
CT_282
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-Good committed Oct 15, 2024
1 parent ef3dfad commit 8764bbc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions BOJ/Java/src/B4/Boj_4696_Stlves.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package B4;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class Boj_4696_Stlves {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringBuilder sb = new StringBuilder();

double n;

while ((n = Double.parseDouble(br.readLine())) != 0) {
sb.append(String.format("%.02f\n", 1.0 + n + Math.pow(n, 2) + Math.pow(n, 3) + Math.pow(n, 4)));
}
bw.write(sb.toString());
bw.flush();
}
}

0 comments on commit 8764bbc

Please sign in to comment.