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

📄 total5w.c

📁 linux下的C语言开发
💻 C
字号:
/*-*//******************************************************** * Program: ADD5 -- Adds up 5 numbers.			* *							* * Usage:						* *	Run it, type in 5 numbers and get a total.	* ********************************************************//*+*/#include <stdio.h>int total;      /* total of all the numbers */int current;    /* current value from the user */int counter;    /* while loop counter */char line[80];  /* Line from keyboard */int main() {    total = 0;    counter = 0;    while (counter < 5) {        printf("Number? ");        fgets(line, sizeof(line), stdin);        sscanf(line, "%d", &current);        total += current;        ++counter;    }    printf("The grand total is %d\n", total);    return (0);}

⌨️ 快捷键说明

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