코드비교

Old VersionNew Version
1import java.util.Scanner; 1import java.util.Scanner; 
2public class Main { 2public class Main { 
3public static void main(String[] args) { 3public static void main(String[] args) { 
4Scanner scn = new Scanner(System.in); 4Scanner scan = new Scanner(System.in);
5double m = scn.nextDouble(); 5double m = scan.nextDouble();
6double i = m * 39.3701; 6double i = m * 39.3701; 
7double f = i / 12; 7double f = i / 12; 
8double d_f = f; 8double f1 = Math.floor(f);
9int i_f = (int)f; 9int F, I;
10System.out.printf("%d\n",i_f); 10f -= f1;
11double d_f2 = d_f - i_f; 11i = f * 12;
12double i2 = d_f2 * 12; 12i = Math.floor(i);
13System.out.printf("%d",(int)i2); 13F =(int)f1;
   14I = (int)i;
   15System.out.printf("%d\n%d", F, I);
14} 16} 
15} 17} 
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
double m = scn.nextDouble();
double i = m * 39.3701;
double f = i / 12;
double d_f = f;
int i_f = (int)f;
System.out.printf("%d\n",i_f);
double d_f2 = d_f - i_f;
double i2 = d_f2 * 12;
System.out.printf("%d",(int)i2);
}
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double m = scan.nextDouble();
double i = m * 39.3701;
double f = i / 12;
double f1 = Math.floor(f);
int F, I;
f -= f1;
i = f * 12;
i = Math.floor(i);
F =(int)f1;
I = (int)i;
System.out.printf("%d\n%d", F, I);
}
}