网站开发 手机 电脑,西安模板建站网站,接入网站备案要多久,wordpress个人中心插件1.#xff08;708#xff09;偶数#xff1a;
编写一个程序#xff0c;输出 11 到 100100 之间#xff08;包括 11 和 100100#xff09;的全部偶数。
输入格式
无输入。
输出格式
输出全部偶数#xff0c;每个偶数占一行。
输入样例
No input
输出样例
2
4
6
...… 1.708偶数
编写一个程序输出 11 到 100100 之间包括 11 和 100100的全部偶数。
输入格式
无输入。
输出格式
输出全部偶数每个偶数占一行。
输入样例
No input
输出样例
2
4
6
...
100
运行代码
#includecstdio
#includeiostream
using namespace std;
int main()
{int x;for(int x1;x100;x){if(x%20){coutxendl;}}return 0;
}
2.709奇数
输入一个整数 X输出 11 到 X 之间包括 11 和 X的全部奇数。
输入格式
一个整数 X。
输出格式
输出所有满足条件的奇数每个数占一行。
数据范围
1≤X≤1000
输入样例
8
输出样例
1
3
5
7
运行代码
#includecstdio
#includeiostream
using namespace std;
int main()
{int x,y;ciny;for(int x1;xy;x){if(x%2!0){coutxendl;}}return 0;
}
3.7106个奇数
读取一个整数 X输出 X之后的 66 个奇数如果 X 也是奇数那么它也算作 66 个奇数之一。
输入格式
一个整数 X。
输出格式
所有满足条件的奇数每个占一行。
数据范围
1≤X≤100
输入样例
9
输出样例
9
11
13
15
17
19
运行代码
#includecstdio
#includeiostream
using namespace std;
int main()
{ int x, y;cin y;for (int x y; x y11; x){if (x % 2 ! 0){cout x endl;}}return 0;
}
4.711乘法表
输入格式
一个整数 N。
输出格式
输出 N 的乘法表具体形式参照输出样例。
数据范围
1N1000
输入样例
140
输出样例
1 x 140 140
2 x 140 280
3 x 140 420
4 x 140 560
5 x 140 700
6 x 140 840
7 x 140 980
8 x 140 1120
9 x 140 1260
10 x 140 1400
运行代码
#includecstdio
#includeiostream
using namespace std;
int main ()
{int x,j;cinx;for(int y1;y10;y){printf(%d x %d %d,y,x,y*x);printf(\n);}return 0;
}
5.712正数
输入格式
六个数字每个占一行。
输出格式
输出格式为 x positive numbers其中 x 为正数的个数。
数据范围
输入数字的绝对值不超过 100100。
输入样例
7
-5
6
-3.4
4.6
12
输出样例
4 positive numbers
运行代码
#includecstdio
#includeiostream
using namespace std;
int main()
{float x;int l0;for(int i1;i6;i){cinx;if(x0){l;}}coutl positive numbersendl;return 0;
}
6.713区间2
输入格式
第一行包含整数 N表示共有 N个整数需要进行判断。
接下来 N行每行包含一个整数 X。
输出格式
第一行输出 x in其中 x 为在范围内的整数的数量。
第二行输出 y out其中 y为在范围外的整数的数量。
数据范围
1≤N≤100001≤≤10000, −107X107
输入样例
4
14
123
10
-25
输出样例
2 in
2 out
运行代码
#includecstdio
#includeiostream
using namespace std;
int main()
{int n;int in0;int out0;cinn;for(int j1;jn;j){int x;cinx;if(x 10 x 20){in;}else{out;}}printf(%d in\n,in);printf(%d out,out);return 0;
}