编辑代码

#include <stdio.h>
#include <string.h>
//The number is founded the  location
//正整数n的左起第k个数 

int digit(int n ,int k)
{
    int i,temp1,temp2;
    for(i=0;i<k;i++)
    {
        printf("n is :%d\n",n);
        temp1=n%10;
        n=n/10;
        //printf("%d\n",temp1);
    }
    if(temp1==0) return -1;
}
int main () {
    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
	int m;
    printf("请输入一个正整数:\n");
    gets(i);
    m=digit(i,6);
    printf("the location  is:%d",m);
	return 0;
}