关于C语言编程

[复制链接]
查看11 | 回复1 | 2010-10-28 19:47:21 | 显示全部楼层 |阅读模式
编写C程序:从键盘读入一行字符,只回显其中的字母、数字和空格字符。例如,如果输入是"Let's meet at 6:00pm.",输出为"Lets meet at 600pm"。
#include
int main(){
char nextChar;
printf("Input a string:");
do{
scanf("%c",&nextChar);
if(('a'int main(){ char nextChar; printf("Input a string:"); do{scanf("%c",&nextChar);if(('a'<=nextChar)&&(nextChar<='z')||('A'<=nextChar)&&(nextChar<='Z')||('0'<=nextChar)&&(nextChar<='9')) printf("%c",nextChar);else
if(nextChar==' ')
printf(" "); else
printf("");}whi
回复

使用道具 举报

千问 | 2010-10-28 19:47:21 | 显示全部楼层
main函数没有返回
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行