1) folosind while
#include <iostream>
using namespace std;
int main()
{
int a, b, an;
cin>>a>>b;
an=a;
while(an<=b){
if((an%4==0 && an%100!=0) || an%400==0)
cout<<an<<' ';
an++;
}
return 0;
}
2) folosind do while
#include <iostream>
using namespace std;
int main()
{
int a, b, an;
cin>>a>>b;
an=a;
do{
if((an%4==0 && an%100!=0) || an%400==0)
cout<<an<<' ';
an++;
}while(an<=b);
return 0;
}