array.c

来自「C.Game.Programming.For.Dummies原码」· C语言 代码 · 共 21 行

C
21
字号
/* Simple array program */

#include <stdio.h>

void main()
{
	int x,f;
	char input[3];	//for storing text input
	int favs[4];	//five items in array

	printf("Please enter five of your favorite numbers\n");
	printf("Between 1 and 100.\n");

	for(x=0;x<5;x++)
	{
		printf("#%i favorite number is:",x+1);
		f=atoi(gets(input));
		favs[x]=f;
	}
}

⌨️ 快捷键说明

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