[Làm Quen OJ]. Bài 32. Số chia hết cho 3 5 hoặc 11.

View as PDF

Submit solution

Points: 1.00 (partial)
Time limit: 1.0s
Memory limit: 256M
Input: stdin
Output: stdout

Problem source:
28Tech
Problem type
Allowed languages
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Cho số nguyên dương N, bạn hãy kiểm tra N có chia hết cho ít nhất 1 trong 3 số 3, 5 hoặc 11 hay không? Nếu có hãy in ra true, ngược lại in ra false.

Các bạn có thể làm theo hướng dẫn này, trong đó ???????? sẽ là biểu thức để kiểm tra.

bool check = ????????;
cout << boolalpha << check << endl;

Đầu vào
  • Dòng duy nhất chứa N

Giới hạn
  • 0 <= N <= 10^18

Đầu ra
  • In ra true hoặc false

Ví dụ :

Input 01
44
Output 01
true

Comments

Please read the guidelines before commenting.



  • 0
    pvt6_0023  commented on March 1, 2026, 3:23 a.m.

    include <bits/stdc++.h>

    using namespace std;

    int main() { iosbase::syncwith_stdio(false); cin.tie(NULL); long long n;cin>>n; (n%3==0 or n%5==0 or n%11==0)?cout<<"true":cout<<"false"; return 0; }


  • 0
    TIEN_DAT_EPE_2006  commented on Feb. 27, 2026, 8:14 a.m.

    include <bits/stdc++.h>

    using namespace std; int main(){ long long n; cin >> n; bool check = (n % 3 == 0 || n % 5 == 0 || n % 11 == 0); cout << boolalpha << check << endl; return 0; }