欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > python >内容正文

python

1.9 编程基础之二分查找 13:整数去重 python

发布时间:2025/3/15 python 29 豆豆
生活随笔 收集整理的这篇文章主要介绍了 1.9 编程基础之二分查找 13:整数去重 python 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

http://noi.openjudge.cn/ch0109/13/

"""1.9 编程基础之二分查找 13:整数去重 http://noi.openjudge.cn/ch0109/13/Python字符串去重 https://www.jianshu.com/p/b9162f389b5c https://www.cnblogs.com/zhenghiber/p/15110871.htmlPython:对输入的单词进行字典序排序输出 https://www.cnblogs.com/JodieRao/p/12635910.htmlPython 程序按字母顺序对单词进行排序 https://www.nhooo.com/python/python-examples-alphabetical-order.htmlPython常用的几种去重方式 https://blog.csdn.net/qq_40304090/article/details/82020576python实现整数去重并排序 https://blog.csdn.net/weixin_45912307/article/details/108661232"""n=int(input())a=list(map(int,input().split(' ')))#a.sort()b=[]for word in a:if not word in b:b.append(word)for i in b:print(i,end=' ')

C++代码:

/* 1.9编程基础之顺序查找_13整数去重 http://noi.openjudge.cn/ch0109/13/ */ #include <bits/stdc++.h> using namespace std; int main( void ) {int n,a,h[20010]={0};cin>>n;for (int i=1;i<=n;i++){cin>>a;if (h[a]==0) {cout<<a<<" ";} h[a]++; }return 0; }

总结

以上是生活随笔为你收集整理的1.9 编程基础之二分查找 13:整数去重 python的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。