

Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
while (n % 2 == 0)
{
n /= 2;
}
while (n % 3 == 0)
{
n /= 3;
}
if (n == 1)
{
cout << 1;
}
else
{
cout << 0;
}
return 0;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
![]()
Hiện tại thì 3 test trên đã đúng hết!
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int d=0;
for (int x=0; x<=n; x++) {
for (int y=0; y<=n ;y++)
if (pow(2,x)*pow(3,y)==n) {
d++;
break;
}
if (d==1) break;
}
cout << d;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
![]()
Bảng tin
211
2180
224
test họ bài này coi đúng chx