Problem Description
大师兄在取得真经后,每天详读经书,认真完成读书笔记,理论联系实际,不断提高实践能力。假设大师兄开始修炼的第一天是星期一,至今已经修炼了N天,那么有多少天是星期六或者星期日,大师兄还在修炼呢?
Input
每组输入数据包含一个整数N(0<N<100,000)。
Output
对每组输入数据,输出一行,仅包含一个整数,表示这N天中是星期六或者星期日的天数。
Sample Input
5 6 7 12 13 14
Sample Output
0 1 2 2 3 4
水题
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main()
{
int n;
while(~scanf("%d",&n))
{
int k = n/7;
if(n%7 == 6)
printf("%d\n",k*2+1);
else if(n%7 == 0)
printf("%d\n",k*2);
else
printf("%d\n",k*2);
}
return 0;
}