Merge branch 'main' of http://10.10.14.176:3000/huanghai/python
commit
605fddfca5
@ -1 +0,0 @@
|
||||
https://blog.csdn.net/abilix_tony/article/details/132529875
|
Binary file not shown.
@ -1,37 +1,21 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
int a[1010];
|
||||
int main() {
|
||||
int T;
|
||||
cin >> T;
|
||||
while (T--) {
|
||||
int a;
|
||||
cin >> a;
|
||||
string dw;
|
||||
cin >> dw;
|
||||
char dh;
|
||||
cin >> dh;
|
||||
char wh;
|
||||
cin >> wh;
|
||||
string dw2;
|
||||
cin >> dw2;
|
||||
int sum = 0;
|
||||
// 我天~可算是录完了
|
||||
|
||||
if (dw == "m")
|
||||
sum = a * 1000;
|
||||
else if (dw == "km" && dw2 == "mm")
|
||||
sum = a * 1000000;
|
||||
else if(dw=="km"&&dw2=="m")
|
||||
sum = a * 1000;
|
||||
else if(dw=="kg"&&dw2=="mg")
|
||||
sum = a * 1000000;
|
||||
else if(dw=="kg"&&dw2=="g")
|
||||
sum = a * 1000;
|
||||
else if(dw=="g")
|
||||
sum = a * 1000;
|
||||
//计算完成!!
|
||||
|
||||
cout << a << " " << dw << " = " <<sum<<" "<< dw2 << endl;
|
||||
int n;
|
||||
int cnt = 0;
|
||||
cin >> n;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cin >> a[i];
|
||||
}
|
||||
for (int i = 1; i <= n; i++) {
|
||||
for (int j = i + 1; j <= n; j++) {
|
||||
int x;
|
||||
x = a[i] + a[j];
|
||||
if (sqrt(x) * sqrt(x) == x)
|
||||
cnt += 1;
|
||||
}
|
||||
}
|
||||
cout << cnt;
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
选择排序不是稳定的排序算法
|
||||
https://blog.csdn.net/weixin_39644325/article/details/111584150
|
||||
数组 6、7、6、2、8
|
||||
|
||||
不稳定排序算法有哪些
|
||||
https://blog.csdn.net/Maxiao1204/article/details/108907709
|
||||
|
||||
不稳定排序算法有哪些
|
||||
口诀:一堆(堆)希尔(希尔)快(快速)选(选择)
|
||||
|
||||
======================================================
|
||||
桶排不讨论是不是稳定
|
||||
桶排的例子
|
||||
|
||||
6 7 6 2 8
|
||||
|
||||
|
||||
int a[10]={};
|
||||
|
||||
1 2 1 1
|
||||
1 2 3 4 5 6 7 8
|
||||
|
||||
2 6 6 7 8
|
||||
|
||||
C++ 运算符
|
||||
https://www.runoob.com/cplusplus/cpp-operators.html
|
Loading…
Reference in new issue