//天数转换为周数和天数,利用while循环重复输入
#include <stdio.h>
int main (void)
{
int week,day,day2;
printf ("请输入天数:");
scanf ("%d",&day);
while (day>0)
{
week = day/7;
day2 = day&7;
printf ("%d days 等于 %d周%d days\n",day,week,day2);
printf ("请输入下一个值:");
scanf ("%d",day);
}
printf ("done");
system ("pause");
return 0;
}
default_null
相关分类