21.c
来自「《C语言实战105例》,一些常用的c语言源代码」· C语言 代码 · 共 20 行
C
20 行
#include<stdio.h>
int main()
{
int i,j,count;
clrscr();
puts("***********************************************");
puts("* this program will solve *");
puts("* the problem about colorful boll *");
puts("***********************************************");
puts("The the result is:\n");
printf(" RED BALL WHITE BALL BLACK BALL\n");
count = 1;
for(i=0;i<=3;i++) /*i是红球个数,作为外层循环变量*/
for(j=0;j<=3;j++) /*j是白球个数,作为内层循环变量*/
if((8-i-j)<=6)
printf(" %d %d %d\n",count++,i,j,8-i-j);
getch();\
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?