能不能简化下代码,现在在学while循环。
就是做一个求输入分钟如果小时小于100则继续再输入计算。
#include<stdio.h>
#define TIME 60
int main(void)
{
int times, SHI, fen;
printf("please add times\n");
scanf("%d", ×);
SHI = times/TIME;
printf("SHI is %d \n", SHI);
while (SHI<100)
{
scanf("%d", ×);
SHI = times / TIME;
fen = times % TIME;
printf("SHI is %d \n", SHI);
printf("fen is %d \n", fen);
}
return 0;
}