标题:请高手来帮我做几道C语言编程题?
只看楼主
guoming1232006
Rank: 2
等 级:新手上路
威 望:4
帖 子:438
专家分:0
注 册:2008-11-20
得分:0 
LZ,你心中“好心人”的定义是什么?
你一下发一两道题上来,态度好点,绝对有人帮你做,但是你一下发了一大堆,神看了也不耐烦啊。
PS:我不是好心人。

寡人有疾,寡人好色......
2008-12-12 15:51
q260548893
Rank: 2
等 级:论坛游民
帖 子:24
专家分:46
注 册:2010-2-4
得分:0 
#include <stdio.h>
void main()
{
    int i, t, now=1, front=0;
   
    for(i=0; i<10; i++)
    {
        printf("%3d",now);
        t=now;
        now += front;
        front=t;
        if(i==4) printf("\n");
    }
    printf("\n");
}
2010-02-21 15:26
q260548893
Rank: 2
等 级:论坛游民
帖 子:24
专家分:46
注 册:2010-2-4
得分:0 
#include <stdio.h>
void main()
{
    int alphabet=0, space=0, digit=0, others=0;
    char ch;
   
    printf("Input a text end of ctrl+z:");
    while((ch=getchar())!= EOF)
    {
        if(ch>='a' && ch<='z' || ch>='A' && ch<='Z')
            alphabet++;
        else if(ch==' ')
            space++;
        else if(ch>='1' && ch<='9')
            digit++;        
        else
            others++;
    }
    printf("alphabet=%d, space=%d, digit=%d, others=%d",alphabet, space, digit, others);
}
2010-02-21 15:51



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-248580-1-1.html




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

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