710. 六个奇数
读取一个整数X,输出X之后的6个奇数,如果X也是奇数,那么它也算作6个奇数之一。
输入格式
一个整数X。
输出格式
所有满足条件的奇数,每个占一行。
数据范围
1≤X≤100
#include <iostream>
using namespace std;
int main(){
int x,i = 1;
cin>>x;
if(x%2 != 0){
cout<<x<<endl;
while(i < 6){
if(++x % 2 != 0){
cout<<x<<endl;
i++;
}
}
}
else{
while(i <= 6){
if(++x % 2 != 0){
cout<<x<<endl;
i++;
}
}
}
return 0;
}