赞
踩
- #include<stdio.h>
- #define N 50
- int main()
- {
- char str[N];
- int i=1;
- char max,min;
- scanf("%s",str);
- max=str[0];
- min=str[0];
- while(str[i]!='\0')
- {
- if(max<=str[i])
- max=str[i];
- if(str[i]<=min)
- min=str[i];
- i++;
- }
- printf("max=%c,min=%c",max,min);
- return 0;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。