Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- int a;
- scanf("%d", &a);
- bool found = false;
- int count = 0;
- int l;
- int k;
- while(!found){
- a++;
- count++;
- l = abs(a);
- while(l>0){
- k=l%10;
- l/=10;
- if(k==8){
- found = true;
- printf("%d\n", count);
- return 0;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement