| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1458 人关注过本帖
标题:这些期末题目,求大神们帮忙 C语言的
只看楼主 加入收藏
HUANG126
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2016-12-24
收藏
得分:0 
回复 10楼 bjut_Allen
谢谢
2016-12-24 15:49
HUANG126
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2016-12-24
收藏
得分:0 
回复 10楼 bjut_Allen
谢谢啊
2016-12-24 15:50
HUANG126
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2016-12-24
收藏
得分:0 
回复 10楼 bjut_Allen
#include <stdio.h>
main()
{
    int iCountRow;
    char ch;
    iCountRow= 0;
    while((ch = getchar()) != '\n')
        if(ch == '\n')
        ++iCountRow;
            
        
    printf("行数为:%d\n", iCountRow);
   

}26、    设计程序,从键盘上输入一串字符,统计该字符串的行数,输入字符@表示结束。
这样的还需要再加点什么???
2016-12-24 15:57
bjut_Allen
Rank: 9Rank: 9Rank: 9
来 自:平乐园工业技术学校
等 级:蜘蛛侠
威 望:8
帖 子:323
专家分:1223
注 册:2016-10-16
收藏
得分:0 
回复 13楼 HUANG126
#include <stdio.h>
int main()
{
    int iCountRow;
    char ch;
    iCountRow= 0;
    while((ch = getchar()) != '@'){
        if(ch == '\n')
        ++iCountRow;
    }
        
    printf("行数为:%d\n", iCountRow);
    return 0;
}

Code is my life.
2016-12-24 17:06
快速回复:这些期末题目,求大神们帮忙 C语言的
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011123 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved