杭电2549 壮志难酬
2016-12-22 20:49
253 查看
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int t = sc.nextInt(); for (int i = 0; i < t; i++) { double d = sc.nextDouble(); int n = sc.nextInt(); String str = String.valueOf(d); int start = str.indexOf("."); String PointbBehind = str.substring(start+1, str.length()); int lenght = PointbBehind.length(); if (lenght >= n) { char result = PointbBehind.charAt(n - 1); System.out.println(result); } else if(lenght<n){ System.out.println("0"); }else{ } } } } }
相关文章推荐
- 杭电2549 壮志难酬
- hdoj-2549-壮志难酬(解题报告)
- 杭电oj2549
- HDU-2549-壮志难酬
- HDU 2549.壮志难酬
- 壮志难酬 2549
- 【KMP】杭电2549(第一次用java写kmp算法)
- HDU 2549 壮志难酬
- 杭电2549
- HDOJ/HDU 2549 壮志难酬(取小数点后几位~)
- HDOJ/HDU 2549 壮志难酬(取小数点后几位~)
- 杭电 2549 壮志难酬 水题
- 杭电 2055 An easy problem
- 杭电1671——Phone List(字典树的应用)
- 杭电骨头收集者
- 杭电 hdu 5625 Clarke and chemistry【水题】
- 杭电-三角形
- 【杭电】[2042]不容易系列之二
- 杭电2047 阿牛的EOF牛肉串
- 杭电1003找最大值