코드비교

Old VersionNew Version
1import java.util.*; 1import java.util.Scanner;
2public class Main { 2public class Main { 
3public static void main(String[] args) { 3public static void main(String[] args) { 
4Scanner sc = new Scanner(System.in); 4Scanner in = new Scanner(System.in);
5double n = sc.nextDouble(); 5double n = in.nextDouble();
6double s = sc.nextDouble(); 6double s = in.nextDouble();
7double a = (n*s*s)/(4.0*Math.tan(Math.PI/n)); 7double a = (n*s*s)/(4*Math.tan(Math.PI/n));
8System.out.printf("%.2f",Math.floor(a*100.0)/100.0); 8System.out.printf("%.2f", (int)(a*100)/100.0);
9} 9} 
10} 10} 
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double n = sc.nextDouble();
double s = sc.nextDouble();
double a = (n*s*s)/(4.0*Math.tan(Math.PI/n));
System.out.printf("%.2f",Math.floor(a*100.0)/100.0);
}
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double n = in.nextDouble();
double s = in.nextDouble();
double a = (n*s*s)/(4*Math.tan(Math.PI/n));
System.out.printf("%.2f", (int)(a*100)/100.0);
}
}