Skip to content

Commit

Permalink
【update】笔试-iHandy-180927
Browse files Browse the repository at this point in the history
  • Loading branch information
imhuay committed Sep 27, 2018
1 parent 9140e68 commit cc806da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions D-笔试面经/笔试-iHandy-180927.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ s.sort(reverse=True)

ans = ''.join(s)

print(int(ans))
print(int(ans)) # 转 int
```

**自定义排序**(80%)
- 代码应该没什么问题,最后把结果转成 `int/long long` 应该就能 AC 了——可能有一个用例是全 0
- 上面用贪心的时候还记得转 int,这里就忘了...
```C++
#include <iostream>
#include <string>
Expand Down Expand Up @@ -72,7 +74,7 @@ int main() {
for (int i=0; i < n; i++)
cin >> ns[i];

cout << foo(ns);
cout << foo(ns); // 这里把结果转成整型应该就行了
return 0;
}
```

0 comments on commit cc806da

Please sign in to comment.