输入样例:
2
M 1.75
F 1.8
输出样例:
1.61
1.96
import java.util.Scanner;public class Main {
public static void main(String[] args) {Scanner scanner = new Scanner(System.in);int n=scanner.nextInt();String[][] str=new String[n][2];for(int i=0;i<n;i++) {for(int j=0;j<2;j++) {str[i][j]=scanner.next();}}for(int i=0;i<n;i++) {if(str[i][0].equals("M")) {double a = Double.parseDouble(str[i][1])/1.09;System.out.printf("%.2f",a);}if(str[i][0].equals("F")) {double a = Double.parseDouble(str[i][1])*1.09;System.out.printf("%.2f",a);}if(i!=n-1) {System.out.println();}}
}
}