标题:这个错误应该怎么修改?
取消只看楼主
we921
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2007-9-20
 问题点数:0 回复次数:0 
这个错误应该怎么修改?

#include <stdio.h>
#include <windows.h>

#define N 20

void sjxsb(float,float,float);//此函数用于判断三角形的类型

/*此结构用于存放三角形的三边*/
struct sjx
{
float bian[3];//存放三角形的三条边
};

void main()
{
struct sjx sjx1[N];
int i,num;
printf("\n请输入您要判断的三角形的个数:");
scanf("%d",&num);
for (i=0;i<num;i++)
{
printf("\n请输入三角形的三边,用空格隔开:");
scanf("%f %f %f",&sjx1.bian[0],&sjx1.bian[1],&sjx1.bian[2]);

sjxsb(sjx1.bian[0],sjx1.bian[1],sjx1.bian[2]);

system("pause");
}

}

void sjxsb(float a,float b,float c)//此函数用于判断三角形的类型
{
if(a==b && b==c)
printf("\n该三角形为等边三角形\n\n");
else if(a==b || a==c || b==c)
printf("\n该三角形为等腰三角形\n\n");
else
printf("\n该三角形不是等边三角形\n\n");
}




我用工具检测结果:
--------------------Configuration: cx - Win32 Debug--------------------
Compiling...
cx.cpp
c:\documents and settings\administrator\桌面\cx.cpp(23) : error C2228: left of '.bian' must have class/struct/union type
c:\documents and settings\administrator\桌面\cx.cpp(23) : error C2228: left of '.bian' must have class/struct/union type
c:\documents and settings\administrator\桌面\cx.cpp(23) : error C2228: left of '.bian' must have class/struct/union type
c:\documents and settings\administrator\桌面\cx.cpp(25) : error C2228: left of '.bian' must have class/struct/union type
c:\documents and settings\administrator\桌面\cx.cpp(25) : error C2228: left of '.bian' must have class/struct/union type
c:\documents and settings\administrator\桌面\cx.cpp(25) : error C2228: left of '.bian' must have class/struct/union type
执行 cl.exe 时出错.

cx.obj - 1 error(s), 0 warning(s)

搜索更多相关主题的帖子: void 三角形 include 
2007-10-13 16:46



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




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

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