期中实验一
读入3个分别表示箱子长、宽、高的整数值,判断并输出该箱子是立方体还是长方体
比较简单,直接上代码
#include<stdio.h>
void main()
{
int length,width,height;
printf("Please enter the length, width and height of the box\n");
scanf("%d %d %d",&length,&width,&height);//喜欢用空格,不喜欢用逗号
if(length==width&&length==height)
printf("The box is a cube\n");
else printf("The box is rectangular\n