We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9140e68 commit cc806daCopy full SHA for cc806da
D-笔试面经/笔试-iHandy-180927.md
@@ -39,10 +39,12 @@ s.sort(reverse=True)
39
40
ans = ''.join(s)
41
42
-print(int(ans))
+print(int(ans)) # 转 int
43
```
44
45
**自定义排序**(80%)
46
+- 代码应该没什么问题,最后把结果转成 `int/long long` 应该就能 AC 了——可能有一个用例是全 0
47
+- 上面用贪心的时候还记得转 int,这里就忘了...
48
```C++
49
#include <iostream>
50
#include <string>
@@ -72,7 +74,7 @@ int main() {
72
74
for (int i=0; i < n; i++)
73
75
cin >> ns[i];
76
- cout << foo(ns);
77
+ cout << foo(ns); // 这里把结果转成整型应该就行了
78
return 0;
79
}
80
0 commit comments