东方博宜oj1090——1099

1090

#include <bits/stdc++.h>
using namespace std;
int main()
{
	for (int i = 10; i <= 1000; i++)
	{
		if (i % 2 == 0 && i % 3 == 0 && i % 7 == 0)
		{
			cout << i << endl;
		}
	}
}

1091

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int sum1 = 0;
	int sum2 = 0;
	for (int i = 1; i <= n; i++)
	{
		if (i % 2 == 0)
		{
			sum2 += i;
		}
		else
		{
			sum1 += i;
		}
	}
	cout << sum1 << " " << sum2;
}

1092

#include <bits/stdc++.h>
using namespace std;
int main()
{
	cout << 7744;
}

1093

#include <bits/stdc++.h>
using namespace std;
int main()
{
	string a = "abcdefghijklm";
	string b = "nopqrstuvwxyz";
	string c = "zyxwvutsrqpon";
	string d = "mlkjihgfedcba";
	cout << a << endl;
	cout << b << endl;
	cout << c << endl;
	cout << d;
}

1094

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n - i; j++)
		{
			cout << " ";
		}
		for (int j = 1; j <= 2*i-1; j++)
		{
			cout << (char)(i+64);
		}
		cout << endl;
	}
}

1095

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n - i; j++)
		{
			cout << " ";
		}
		for (int j = 1; j <= 2*i-1; j++)
		{
			cout << (char)(j+64);
		}
		cout << endl;
	}
}

1096

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n - i; j++)
		{
			cout << " ";
		}
		for (int j = i; j >0; j--)
		{
			cout << (char)(j+64);
		}
		for (int j = 2; j <= i; j++)
		{
			cout << (char)(j + 64);
		}
		cout << endl;
	}
}

1097

#include <bits/stdc++.h>
using namespace std;
int main()
{
	char a[21];
	int num = 0;
	for (int i = 0; i < 21; i++)
	{
		cin >> a[i];
		num++;
		if (a[i] == '#')
		{
			break;
		}
	}
	int num1 = 0, num2 = 0, num3 = 0;//大写,小写,数字
	for (int i = 0; i < num; i++)
	{
		if (a[i] >= 65 && a[i] <= 90)
		{
			num1++;
		}
		if (a[i] >= 97 && a[i] <= 122)
		{
			num2++;
		}
		if (a[i] >= 48 && a[i] <= 57)
		{
			num3++;
		}
	}
	cout << num1 << " " << num2 << " " << num3;
}

1098

#include <bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
	string a;
	getline(cin, a);
	int num = 1;
	if (a.size() % 2 == 0)
	{
		for (int i = 0; i < a.size() / 2 - 1; i++)
		{
			if (a[i] == a[a.size() - 2 - i])
			{
 
			}
			else
			{
				num = 0;
				break;
			}
		}
	}
	else
	{
		for (int i = 0; i <= (a.size() - 1) / 2; i++)
		{
			if (a[i] == a[a.size() - 2 - i])
			{
 
			}
			else
			{
				num = 0;
				break;
			}
		}
	}
	if (num == 1)
	{
		cout << "TRUE";
	}
	else
	{
		cout << "FALSE";
	}
}

1099

#include <bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
	string a;
	getline(cin, a);
	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] == 79)
		{
			a[i] = 48;
		}
		if (a[i] == 108)
		{
			a[i] = 49;
		}
		if (a[i] == 90)
		{
			a[i] = 50;
		}
		if (a[i] == 83)
		{
			a[i] = 53;
		}
		if (a[i] == 98)
		{
			a[i] = 54;
		}
		if (a[i] == 66)
		{
			a[i] = 56;
		}
		if (a[i] == 113)
		{
			a[i] = 57;
		}
	}
	cout << a;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夏梓乔

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值