#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define pf printf
#define sf scanf
typedef long long ll;
int check(ll n)
{
int count = 0;
if(n<0)
{
n=-n;
}
while(n)
{
if(n%10==8)
{
count++;
}
n=n/10;
}
return count;
}
int main()
{
ll a;
int count, f;
cin >> a;
f=0;
while(1)
{
a++;
f++;
count = check(a);
if(count>=1)
{
break;
}
}
cout<< f << endl;
}
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define pf printf
#define sf scanf
typedef long long ll;
int check(ll n)
{
int count = 0;
if(n<0)
{
n=-n;
}
while(n)
{
if(n%10==8)
{
count++;
}
n=n/10;
}
return count;
}
int main()
{
ll a;
int count, f;
cin >> a;
f=0;
while(1)
{
a++;
f++;
count = check(a);
if(count>=1)
{
break;
}
}
cout<< f << endl;
}
No comments:
Post a Comment