#include
int main()
{
char str[100];
int i,ans=0;
printf("Input a string:\n");
gets(str);
for (i=0;i<=strlen(str)-1;i++)
if (str[i]>ans)
{
ans=str[i];
}
printf("The largest character of \"%s\" is \'%c\' ,The ASCII is %d.",str,ans,ans);
return 0;
}
编程实现找出字符串中最大字符元素并输出该元素及其对应的ASCII值 请问为什么运行显示无输出?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答
- threenewbee 2018-11-26 12:15关注
如果问题解决,请点我回答左上角的采纳,lz之前的问题也没有采纳。
http://ask.csdn.net/questions/713691
认真回答你的问题,耗去很多时间,而所求的回报仅仅是lz举手之劳,希望lz将心比心,谢谢
解决 1无用