Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:提交三次总是WA,求测试数据!

Posted by NJUT_ACM_03 at 2009-04-19 14:36:38 on Problem 1112
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator