104
40.000
100000
55537.778
10000000
5555537.778
1000000000
5.55555537778E8
以上是我的測資
小的答案都正確,到大的就錯了?? why?
import java.util.Scanner;
public class d051 {
public static void main(String[]args){
Scanner input=new Scanner(System.in);
while(input.hasNext()){
double f=input.nextDouble();
long c=(long)((f-32)*5/9*10000);
long ans=c%10>4? (c-c%10)+10:(c-c%10);
double ans2=(double)ans/10000;
long tmp=0;
String s=ans2+"";
for(int i=0;i<s.length();i++){
if(s.charAt(i)=='.'){
tmp=i;
}
}
System.out.println(s.length()-1-tmp==1? ans2+"00":ans2);
}
}
}