作者在 2022-01-30 16:18:10 发布以下内容
我可想见我这个交换数据将会被广泛使用,而且写成<T>型,
我虽然不知道如何申请专利,则这个专利也属于国家的,国家可以维护这个专利。
void 算交换(int& a, int& b)
{
int ab = a - b;
a -= ab; b += ab;
//cout << ab << endl << a << ends << b;
}
int a = INT_MAX, b = INT_MIN;
cout << a << ends << b << endl;
算交换(a, b);
cout << a << ends << b << endl;
void 交换四位数百十后乘积()
{//缘由https://ask.csdn.net/questions/7637632?spm=1005.2025.3001.5141
int a = 0, aa = 0, ab = 0, as = 0;
cin >> a;
aa = a, ab = a / 100 % 10, as = a / 10 % 10;
aa += (ab - as) * 10 + (as - ab) * 100;
cout << (ab - as) * 10 << ends << (as - ab) * 100<<endl;
cout << a << "*" << aa << "=" << a*aa << "\n";
}