#include <iostream>
using namespace std;
int main()
{
int a,b,counter=0;
cin>>a;
cin>>b;
for(int i=a; i<=b; i++)
if((i%3==0) || (i%5==0)) counter++;
}
cout<<counter;
return 0;
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
#include <iostream>
using namespace std;
int main()
{
int a,b,counter=0;
cin>>a;
cin>>b;
for(int i=a; i<=b; i++)
{
if((i%3==0) || (i%5==0)) counter++;
}
cout<<counter;
return 0;
}