hdoj 2549

来源:互联网 发布:知乎 三体问题 编辑:程序博客网 时间:2024/06/04 18:01

http://acm.hdu.edu.cn/showproblem.php?pid=2549

//水题#include <iostream>#include <string>using namespace std;int main(){ int t, n; string num; int flag; cin >> t; while (t--) {  cin >> num >> n;  flag = num.find('.');  if (n > num.length()-flag-1) cout << 0 << endl;  else cout << num[flag+n] << endl; } return 0;}