| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:提交三次总是WA,求测试数据!In Reply To:提交三次总是WA,求测试数据! Posted by:589742 at 2006-09-27 20:22:17 请问这个程序哪里错了
#include<iostream>
#include<string>
#include<stdio.h>
using namespace std;
int main()
{
int N,t,a[100];
cin>>N;
for(int i=0;i<N;i++)
{
cin>>a[i];
}
if(N>=2&&N<=100)
{
t=N/2;
cout<<t<<'\t';
for(int j=2;j<=N;j+=2)
cout<<j;
cout<<endl;
if(!(N%2))
{
cout<<t<<'\t';
for(int k=1;k<=N;k+=2)
cout<<k<<'\t';
cout<<endl;
}
else
{
cout<<t+1<<'\t';
for(int m=1;m<=N;m+=2)
cout<<m<<'\t';
cout<<endl;
}
}
else
cout<<"No solution"<<endl;
system("pause");
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator