Advertisement
haopoka

Bai 67

Jul 30th, 2020
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int n;
  7.     cout << "Nhap n: ";
  8.     cin >> n;
  9.     bool c = false;
  10.     int t = n;
  11.     while (t > 0)
  12.     {
  13.         int dv = t % 10;
  14.         if (dv % 2 != 0)
  15.             c = true;
  16.         t = t / 10;
  17.     }
  18.     if (c)
  19.         cout << "Ton tai chu so le." << endl;
  20.     else
  21.         cout << "Khong ton tai chu so le." << endl;
  22.     return 1;
  23. }
  24.  
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement