题解 | #明明的随机数#

明明的随机数

https://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0

来一波骚操作 0.0

#include <iostream>
using namespace std;
#include <string>
#include <algorithm>
int main() {
    int num;
    cin >> num;
    int* arry = new int[num];
    for (int i = 0; i < num; i++) {
        cin >> arry[i];
    }
    sort(arry, arry + num);

    cout<<arry[0]<<endl;
    for (int i = 1; i < num; i++) {
        if(arry[i]!=arry[i-1])
        {
            cout<<arry[i]<<endl;
        }
    }
 }
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

05-19 15:21
已编辑
华南农业大学 Java
白火同学:你才沟通了200,说实话,北上广深杭这里面你连一座城市的互联网公司都没投满呢,更别说还有各种准一线二线城市了。等你沟通突破了三位数,还没结果再考虑转行的事吧。
点赞 评论 收藏
分享
05-09 14:45
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务