mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1852.cpp
This commit is contained in:
parent
bcbb7fac92
commit
bf120b3cdd
38
QUSTOJ/1852.cpp
Normal file
38
QUSTOJ/1852.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
using namespace std;
|
||||
int a[2048];
|
||||
int b[2048];
|
||||
int c;
|
||||
int d;
|
||||
int main()
|
||||
{
|
||||
int t;
|
||||
int tmp;
|
||||
scanf("%d",&t);
|
||||
for(int i=0;i<t;i++)
|
||||
{
|
||||
scanf("%d",&tmp);
|
||||
if(tmp<=0)
|
||||
{
|
||||
a[c++]=tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
b[d++]=tmp;
|
||||
}
|
||||
}
|
||||
for(int i=0;i<c-1;i++)
|
||||
{
|
||||
printf("%d ",a[i]);
|
||||
}
|
||||
printf("%d\n",a[c-1]);
|
||||
for(int i=0;i<d-1;i++)
|
||||
{
|
||||
printf("%d ",b[i]);
|
||||
}
|
||||
printf("%d\n",b[d-1]);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user