写一个程序居然出现了system error,从来都没遇到过的,请大家帮我看看,指点一下……
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?)问题的解决方法,需要的朋友可以参考借鉴,下面随着小编来一起看看吧。
boost::system::system_error相关的测试程序
boost::system::system_error相关的测试程序实现功能C++实现代码 实现功能 boost::system::system_error相关的测试程序 C++实现代码 #include <boost/system/system_error.hpp> #include <boost/config.hpp> #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 <boost/config/warning_disable.hpp> #include <boost/system/error_code.hpp> #include <boost/core/lightweight_test.hpp> #include <iostream&
boost::system::error_category相关的测试程序
boost::system::error_category相关的测试程序实现功能C++实现代码 实现功能 boost::system::error_category相关的测试程序 C++实现代码 # define _CRT_SECURE_NO_WARNINGS #include <boost/system/error_code.hpp> #include <boost/core/lightweight_test.hpp> #include <cstdio> namespa
system_error解决办法.md
system_error解决办法.md


