⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tri.c

📁 linux下的C语言开发
💻 C
字号:
/*-*//******************************************************** * Question:						* *	This is designed to compute the area of 	* *      a triangle, given its width and height.		* *							* * For some strange reason, the compiler refuses to 	* * believe that we declared the variable "width".	* *							* * The declaration is right there on line 16,	 	* * just after the definition of height.  		* * Why isn't the compiler seeing it?			* ********************************************************//*+*/#include <stdio.h>char line[100];/* line of input data */int  height;   /* the height of the triangleint  width;    /* the width of the triangle */int  area;     /* area of the triangle (computed) */int main(){    printf("Enter width height? ");    fgets(line, sizeof(line), stdin);    sscanf(line, "%d %d", &width, &height);    area = (width * height) / 2;    printf("The area is %d\n", area);    return (0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -