length.c
来自「linux下的C语言开发」· C语言 代码 · 共 29 行
C
29 行
/*-*//******************************************************** * Name: * * length * * * * Purpose: * * Computes the length of a line * * * * Usage: * * Run it, type in a line, get the length. * * * * Limitations * * Line must be 99 characters long or less * ********************************************************//*+*/#include <string.h>#include <stdio.h>char line[100]; /* Line we are looking at */int main(){ printf("Enter a line: "); fgets(line, sizeof(line), stdin); printf("The length of the line is: %d\n", strlen(line)); return (0);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?