| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 694 人关注过本帖
标题:C 的入门级别,求助
只看楼主 加入收藏
NordicNavy
Rank: 1
来 自:地球
等 级:新手上路
帖 子:30
专家分:0
注 册:2008-10-20
收藏
 问题点数:0 回复次数:3 
C 的入门级别,求助
刚学了几天C, 我用dev c++,
安装例子写了练习题,不知道为什么不编译。。。请指教, code 如下:
#include <stdio.h>
#include <stdlib.h>
int main()
{
    float length, width;
    int fnum;
    printf("Please enter the floor number:\n");
    scanf("%d",&fnum);   
    printf("Please enter the length of the area/room:\n");
    scanf("%f", &length);
    printf("Please enter the width of the area/room:\n");
    scanf("%f", &width);   
    area(length, width, fnum);   
}
area(size, wide, num)
float size, wide;
int num;
{
    float area;
    area=size*wide;
    printf("The area of the bluiding %.2f and %d floors", area, num);
    return 0;
}
搜索更多相关主题的帖子: 入门 级别 
2008-10-20 18:36
xiaochu
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-10-20
收藏
得分:0 
#include <stdio.h>
#include <stdlib.h>

 int area(float size, float wide,int num)

{
    float area;
    area=size*wide;
    printf("The area of the bluiding %.2f and %d floors", area, num);
    return 0;
}

int main()
{
    float length, width;
    int fnum;
    printf("Please enter the floor number:\n");
    scanf("%d",&fnum);
    printf("Please enter the length of the area/room:\n");
    scanf("%f", &length);
    printf("Please enter the width of the area/room:\n");
    scanf("%f", &width);
    area(length, width, fnum);
}
2008-10-20 18:52
NordicNavy
Rank: 1
来 自:地球
等 级:新手上路
帖 子:30
专家分:0
注 册:2008-10-20
收藏
得分:0 
传递参数的问题
谢谢,编译了, 虽然对这个传递参数还有点迷糊。。。
2008-10-20 19:05
口水龙
Rank: 1
来 自:韶关
等 级:新手上路
帖 子:8
专家分:0
注 册:2008-10-20
收藏
得分:0 
跟我想的一样吖o(∩_∩)o...

想学好编程,必须要有一颗不怕烦躁的心。。。
2008-10-20 19:09
快速回复:C 的入门级别,求助
数据加载中...
 
   



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

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