现在的位置: 首页 > 综合 > 正文

hdoj 2549

2019年07月31日 ⁄ 综合 ⁄ 共 264字 ⁄ 字号 评论关闭

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;
}

 

【上篇】
【下篇】

抱歉!评论已关闭.