用for、while、do-while循环输出10句“好好学习,天天向上!”
1 #include "stdio.h" 2 void main() 3 { 4 int time; 5 for (time=1;time<=10;time++) 6 printf("%d、好好学习,天天向上!\n",time); 7 }
#include "stdio.h"
void main()
{
int time=1;
while (time<=10)
{
printf("%d、好好学习,天天向上!\n",time);
time++;
}
}
#include "stdio.h" void main() { int time=1; do { printf("%d、好好学习,天天向上!\n",time); time++; } while(time<=10); }