/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#include
int main (void)
{
unsigned int i, n = 0, upper, lower;
printf ("Define lower page limit: ");
scanf ("%u", &lower);
printf ("Define upper page limit: ");
scanf ("%u", &upper);
printf ("Front pages are: ");
for (i = lower ; i <= upper ; i++)
{
if (n == 0 || n == 1)
{
n++;
printf ("%u,",i);
continue;
}
if (n == 2)
{
n++;
continue;
}
if (n == 3)
{
n = 0;
continue;
}
}
n = 0;
printf ("\nBack pages are: ");
for (i = lower ; i <= upper ; i++)
{
if (n == 0 || n == 1)
{
n++;
continue;
}
if (n == 2)
{
printf ("%u,",i);
n++;
continue;
}
if (n == 3)
{
printf ("%u,",i);
n = 0;
continue;
}
}
printf ("\n");
return 0;
}