写一个程序居然出现了system error,从来都没遇到过的,请大家帮我看看,指点一下……

u010672692 u010672692 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Sorting Again


Time Limit: 2000MS Memory Limit: 65535KB
Submissions: 461 Accepted: 93

Description新春过后的第一次比赛,相信大家都已经准备好了。那么就为大家热下身吧。问题很简单,对一组输入的数据进行排序。 对输入的数据,我们有如下的约定:所有的输入数据都为正整数,且都不大于300000000。但是输入的数据可能会有重复,排序时,应将重复的数据合并,即同样的数只处理一次。

Input只有一组数据,以0结尾。

Output输出排序后的数据(不含0),其中相同的数应只显示1个。


相邻数之间有一个空格


最后是一个空格和一个换行


Sample Input

1 2 2 3 4 0

Sample Output

1 2 3 4
我的代码:
#include<stdio.h>
int a[300000001];
int main()
{
int m,max,i;
for(i=0;;i++)
{
scanf("%d",&m);
if(m==0) break;
a[m]++;
if(m>max)
max=m;
}
for(i=0;i<=max;i++)
{
if(a[i]>0)
{
printf("%d ",i);
}
}
printf("\n");
return 0;
}
...全文

相关推荐

Linux使用vim编辑文件保存时报E514:write error (file system full?)问题解决

最近在用vi编辑文档,保存的时候,提示如下错误:E514: write error (file system full?),所以这篇文章主要给大家介绍了关于Linux使用vim编辑文件保存时报E514:write error (file system full?)问题的解决方法,需要的朋友可以参考借鉴,下面随着小编来一起看看吧。

weixin_38499732

boost::system::system_error相关的测试程序

boost::system::system_error相关的测试程序实现功能C++实现代码 实现功能 boost::system::system_error相关的测试程序 C++实现代码 #include &lt;boost/system/system_error.hpp&gt; #include &lt;boost/config.hpp&gt; #if defined(THROW_DYN_LINK) # define EXPORT BOOST_SYMBOL_EXPORT #else # define EX

源代码大师

boost::system::error_code相关的测试程序

boost::system::error_code相关的测试程序实现功能C++实现代码 实现功能 boost::system::error_code相关的测试程序 C++实现代码 #include &lt;boost/config/warning_disable.hpp&gt; #include &lt;boost/system/error_code.hpp&gt; #include &lt;boost/core/lightweight_test.hpp&gt; #include &lt;iostream&

源代码大师

boost::system::error_category相关的测试程序

boost::system::error_category相关的测试程序实现功能C++实现代码 实现功能 boost::system::error_category相关的测试程序 C++实现代码 # define _CRT_SECURE_NO_WARNINGS #include &lt;boost/system/error_code.hpp&gt; #include &lt;boost/core/lightweight_test.hpp&gt; #include &lt;cstdio&gt; namespa

源代码大师

system_error解决办法.md

system_error解决办法.md

寂然如故
评论 12
收藏 已收藏
分享
返回顶部
u010672692
C语言 70,039 成员 243,237 内容