编写一个C语言程序,关于“统计一条英文句子中字母的个数,在主程序中实现输入输出”

[复制链接]
查看11 | 回复1 | 2011-6-14 09:25:18 | 显示全部楼层 |阅读模式
句子【I am your father】有单词4个。Press any key to continue#include "stdio.h"#include "string.h"int main(){int i,j,k=0,len,mark=0,count=0;char str[]="I am your father";len = strlen(str);for (i=0;i<len;i++){if (str==' '){mark=1;count++;}}printf("句子【%s】有单词%d个\n。",str,count+1);...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行