Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
*Pascal
Program Dem;
var L,R, dem,i:longint;
begin
repeat
write('L= ');readln(L);
write('R= ');readln(R);
until ( L<R) and (L>1);
d:=0;
for i:=L to R do
if i mod 10=0 then inc(d);
writeln('So luong so tron chuc: ',d);
readln
end.
*C++
#Include iostream
Using namespace std;
int main()
{
Longlong R,L,i,d=0;
cout<<"L= ";
cin>>L;
cout<<"R= ";
cin>>R;
for (i=L;i<=R;i++){
if (i % 10 ==0)
d++;}
cout<<"So luong so tron chuc: "<<d;
return 0;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
#include<bits/stdc++.h>
#define int long long
using namespace std;
int l,r,dem=0;
bool hello (int n)///hàm kiểm tra số tròn chục
{
if(n%10==0)
return 1;
return 0;
}
main()
{
cin>>l>>r;
for(int i=l;i<=r;i++)
if(hello(i))
dem++;
cout<<dem;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin