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 壮志难酬
最新推荐文章于 2019-11-24 17:04:20 发布