//天数转换为周数和天数,利用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;}
- 2 回答
- 0 关注
- 1593 浏览
添加回答
举报
0/150
提交
取消