Advertisement
lammac

Tìm số đẹp (lộc phát)

Apr 3rd, 2020
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3.     int n, t;
  4.     scanf("%d", &n);
  5.     while( n > 0 && n < 1000000000){
  6.         t = n%10;
  7.         if(t == 0 || t == 6 || t == 8){
  8.             n = n/10;
  9.         }
  10.         else break;
  11.     }
  12.     if ( n == 0) printf("1");
  13.     else printf("0");
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement