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

hdu 2549

2013年08月06日 ⁄ 综合 ⁄ 共 319字 ⁄ 字号 评论关闭
//   http://acm.hdu.edu.cn/showproblem.php?pid=2549
//   这里有一个比较坑爹的地方,就是当我们找的那个数字时,数据没那么长,这时候就要输出0,其他没社么可说的
 #include<stdio.h>
#include<string.h>
int main()
{
	char a[1000];
	int t,n,i;
	while(scanf("%d",&n)!=EOF)
	{
		scanf("%s%d",&a,&n);
                 for(i=0;a[i];i++)
			if(a[i]=='.')
			  break;
           if(n>strlen(a)-i-1)
                 printf("0\n");
           else
                 printf("%c\n",a[i+n]);
	}
	return 0;
}

抱歉!评论已关闭.