Merge branch 'main' of http://10.10.14.176:3000/huanghai/python
commit
56c17dc0e8
@ -0,0 +1,32 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
/**
|
||||||
|
2
|
||||||
|
1 km = ? mm
|
||||||
|
1 m = ? mm
|
||||||
|
*/
|
||||||
|
int main() {
|
||||||
|
int m;
|
||||||
|
cin >> m;
|
||||||
|
while (m--) {
|
||||||
|
int a;
|
||||||
|
cin >> a; // 第一个数字
|
||||||
|
string b;
|
||||||
|
cin >> b; // 第一个单位
|
||||||
|
string c, d; // 等号与问号
|
||||||
|
cin >> c >> d; // 用不上,只读不用
|
||||||
|
string e;
|
||||||
|
cin >> e; // 第二个单位
|
||||||
|
|
||||||
|
if (b[0] == 'k') {
|
||||||
|
if (e.size() == 1)
|
||||||
|
cout << a << " " << b << " = " << a * 1000 << e << endl;
|
||||||
|
else
|
||||||
|
cout << a << " " << b << " = " << a * 1000000 << e << endl;
|
||||||
|
} else {
|
||||||
|
cout << a << " " << b << " = " << a * 1000 << e << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Binary file not shown.
@ -0,0 +1,19 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int i, j;
|
||||||
|
for (i = 6;; i += 5) {
|
||||||
|
int x = i;
|
||||||
|
for (j = 0; j < 5; j++) {
|
||||||
|
if ((x - 1) % 5 != 0 || x <= 1) // 扔掉一个是否能分成5份
|
||||||
|
break; // 不符合要求
|
||||||
|
x = (x - 1) / 5 * 4; // 分完第j+1次后剩下的桃子
|
||||||
|
}
|
||||||
|
if (j == 5) { // 符合条件
|
||||||
|
printf("%d", i);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1,7 +1,37 @@
|
|||||||
#include <bits/stdc++.h>
|
#include <bits/stdc++.h>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
int main() {
|
int main() {
|
||||||
int list[10] = {1};
|
int T;
|
||||||
cout << list;
|
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;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in new issue