好久没做CSDN的题了 做个水题感受一下
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <string>
#define eps 1e-8
#define op operator
#define MOD 10009
#define MAXN 100100
#define INF 0x7fffffff
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FOV(i,a,b) for(int i=a;i>=b;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define REV(i,a,b) for(int i=a-1;i>=b;i--)
#define MEM(a,x) memset(a,x,sizeof a)
#define ll __int64
using namespace std;
int main()
{
//freopen("ceshi.txt","r",stdin);
int n;
while(scanf("%d",&n)!=EOF)
{
int x=n%8;
if(x<5&&x>0)
printf("%d\n",x);
else
{
if(x==0)
printf("2\n");
else
{
printf("%d\n",10-x);
}
}
}
return 0;
}