/*
播布客教学视频_C学习笔记_3_打印输出
循环打印
“++”的使用
循环条件的判断过程
while和do—while的区别
*/
#include<stdio.h>
int main(void)
{
int counter = 0;//手指头没有伸出来
printf("counter your fingers\n");
/*
//counter先加1
counter = 0;
while(counter < 10)//判断条件,为1时一直执行下去
{
counter++;
printf("counter = %d\n",counter);
}
*/
/*
//counter先打印再加1
counter = 1;
while(counter <= 10)
{
printf("counter = %d\n",counter);
counter++;
}
*/
//counter先加1
counter = 0;
do
{
counter++;
printf("counter = %d\n",counter);
}while(counter <= 10);//注意加分号
return 0;
}
播布客教学视频_C学习笔记_3_计算手指个数
最新推荐文章于 2022-01-28 15:23:56 发布