875-24
作者:
3include
,
2024-12-17 22:40:48
,
所有人可见
,
阅读 1
T1:
#include <iostream>
using namespace std;
int count(int x)
{
int res = 1;
for (int i = 2; i * i <= x; i ++) {
if (x % i == 0) {
res += i;
if (i * i != x)
res += x / i;
}
}
return res;
}
int main()
{
for (int i = 1; i <= 10000; i ++) {
int j = count(i);
int t = count(j);
if (i < j && i == t)
cout << i << ' ' << j << endl;
}
return 0;
}
T2:
#include <iostream>
#include <unordered_map>
using namespace std;
int main()
{
string s, t;
cin >> s >> t;
bool flag = true;
unordered_map<char, int> count;
for (char c: s)
count[c] ++;
for (char c: t)
count[c] --;
for (char m = 'a'; m <= 'z'; m ++)
if (count[m] != 0)
flag = false;
for (char n = 'A'; n <= 'Z'; n ++)
if (count[n] != 0)
flag = false;
if (flag)
puts("true");
else
puts("false");
return 0;
}