小数点后第n位



#include<stdio.h>

#include<math.h>

#include<ctype.h>

#include<string.h>

int main()

{

   
char s[100],*p;

   
p=s;

   
int t,n,i;

   
scanf("%d",&t);

   
getchar();

   
for(i=0;i<t;i++)

    {

       
scanf("%s",s);

       
scanf("%d",&n);

       
p=strchr(s,'.');

       
printf("%c",*(p+n));

    }

 

   
return 0;

}


猜你喜欢

转载自blog.csdn.net/weixin_43918196/article/details/85681043