

Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
$\#duaconngoaihanhlang$
Bạn tham khảo ạ
a = list(map(int, input().split())) count = 0
for num in a:
is_good_number = True
while num > 0:
digit = num % 10
if digit != 6 and digit != 8:
is_good_number = False
break
num //= 10
if is_good_number: count += 1
print(count)
Hãy giúp mọi người biết câu trả lời này thế nào?

#include <bits/stdc++.h>
using namespace std;
int n,x;
int sodep(int n)
{
unsigned int k,l,m,j,b,c;
k=0;l=0;m=0;b=0;j=10;
for(int i=1;i<=n;i=i*10)
k=k+1;
for(int a=1;a<=k;a=a+1)
{
l=n%j;
if(l!=6&&l!=8)
{b=1;continue;}
n=(n-l)/10;
}
if(b!=1)
return 1;
}
int main()
{ cin>>n;
int A[n+10];
for(int i=1;i<=n;i+=1)
{cin>>A[i];
if(sodep(A[i])==1)
x+=1;
}
cout<<x;
}
-LittleShadow-
Hãy giúp mọi người biết câu trả lời này thế nào?

Bảng tin