- #include<stdio.h>
- int main()
- {
- char shuzu[10]={0};
- int s=0;
- while (s<10) {
- printf("请输入第%d个数:\n",s);
- char num;
- scanf("%c%*c",&num);
- shuzu[s]=num;
- s++;
- }
- char min=shuzu[0];
- for (int i=1; i<10; i++) {
- if (min-65>shuzu[i]-65) {
- char tem;
- tem=min;
- min=shuzu[i];
- shuzu[i]=tem;
- }
-
- }
- printf("最接近数字符是%c\n",min);
- return 0;
- }
复制代码 |