結(jié)構(gòu)體中 怎么把volume=length*width*high;加入程序中?
#include<stdio.h>
struct student
{
int length,width,high,volume;
char name[8];
};//結(jié)構(gòu)型定義結(jié)束一定要加分號(hào)
int main()
{
struct student stu[9];
int i,N,temp;
scanf("%d",&N);
for(i=0;i<N;i++)
scanf("%d%d%d%s",&stu[i].length,&stu[i].width,&stu[i].high,stu[i].name);
for(i=0;i<N;i++)
{
if(stu[i].volume>stu[i+1].volume)
{
temp=stu[i].volume;
stu[i].volume=stu[i+1].volume;
stu[i+1].volume=temp;
}
}
printf("%s took clay from %s\n",stu[N-1].name,stu[0].name);
return 0;
}
2022-03-23
不是瀏覽器的問(wèn)題,是調(diào)用谷歌的js庫(kù)文件有問(wèn)題其他三個(gè)組件是在后邊的課程講,在這里知道是在配置文件中注冊(cè)組件的
2017-11-07
#include<stdio.h>
struct student
{
int length,width,high,volume;
char name[8];
};//結(jié)構(gòu)型定義結(jié)束一定要加分號(hào)
int main()
{
struct student stu[9];
int i,N,temp;
scanf("%d",&N);
for(i=0;i<N;i++)
scanf("%d%d%d%s",&stu[i].length,&stu[i].width,&stu[i].high,stu[i].name);
for(i=0;i<N;i++)
{
if(stu[i].volume>stu[i+1].volume)
{
temp=stu[i].volume=length*width*high;
stu[i].volume=stu[i+1].volume;
stu[i+1].volume=temp;
}
}
printf("%s took clay from %s\n",stu[N-1].name,stu[0].name);
return 0;
}