做题
`#define _CRT_SECURE_NO_WARNINGS
include
using namespace std;
int main()
{
int arr[3] = { 0 };
for (int i = 0; i < 3; i++)
{
cin >> arr[i];
}
for(int j = 0 ; j < 3 ; j++)
{
for (int i = 0; i < 2 - j; i++)
{
if (arr[i] > arr[i + 1])
{
int temp = arr[i];
arr[i] = arr[i + 1];
arr[i + 1] = temp;
i = 0;
}
}
}
cout << arr[0] << "->" << arr[1] << "->" << arr[2] << endl;
return 0;
}冒泡排序比较#define _CRT_SECURE_NO_WARNINGS
include
include
using namespace std;
int main() {
string A, B, C;
// 用 getline 读取整行,包括空格
getline(cin, A);
getline(cin, B);
for (char tempA : A)
{
if (B.find(tempA) == string::npos)
{
C = C + tempA;
}
}
cout << C << endl; // 输出处理后的结果
return 0;
}
`
字符串相减

浙公网安备 33010602011771号