前言
其实我实在不想写这道题,可是老师说都要写,我就水水过吧。
正题
大意
求一个区间的奇数
送上我在博客里写过的最短的代码
代码
#include<cstdio>
using namespace std;
int a,b;
int main()
{scanf("%d%d",&a,&b);if (a%2==0) a++;if (b%2==0) b--; printf("%d\n",(b-a+1)/2+1);while (a<=b){printf("%d\n",a);a+=2;}
}