输入一个任意长度的非负整数,求出其最高位数字。如,输入237,则最高位数字为2。
Posted on 2022-09-26 23:09 lachesism 阅读(174) 评论(0) 编辑 收藏 举报#include <stdio.h> main() { int x,t,m; scanf("%d",&x); t=0; m=x; while(x!=0) { x=x/10; t++; } x=m; t=t-1; while(t!=0) { x=x/10; t--; } printf("%d",x); }