#include <stdio.h>
#define time 60
int main(void)
{
float hour ;
int minute;
printf("请输入分钟值:\n");
scanf_s("%d", &minute);
while (minute > 0)
{
hour = (float) minute / time;
printf("%3.2f小时\n",hour);
printf("请输入分钟值:\n");
scanf_s("%d", &minute);
}
return 0;
}
四:
#include <stdio.h>
int main(void)
{
int a,i;
printf("请输入一个整数:\n");
scanf_s("%d", &a);
i = a;
// 修改后的循环条件
while (a++<(i+10))
{
printf("%d\n", a);
}
return 0;
}