import java.util.*;
import java.io.*;
import java.math.*;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(new BufferedInputStream(System.in));
BigDecimal eight = new BigDecimal(8);
String s;
while(cin.hasNext())
{
BigDecimal b = new BigDecimal(1);
BigDecimal ans = new BigDecimal(0);
s = cin.nextLine();
for(int i = 2; i < s.length(); ++i){
b = b.divide(eight);
int temp = s.charAt(i)- 48;
BigDecimal t = BigDecimal.valueOf(temp);
ans = ans.add(t.multiply(b));
}
System.out.println(s + " [8] = " + ans.toString() +" [10]");
}
}
}
poj 1131
最新推荐文章于 2021-03-08 01:22:39 发布