| ||||||||||
| 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 | |||||||||
why 1032 wrong answer, I think it is right.???#include<iostream>
using namespace std;
int main()
{int n;
while(cin>>n)
{
int m;
if(n>=5&&n<=1000)
{
m=n/3;
if(n%3==1)
{
for(int i=0;i<m-1;i++)
cout<<"3 ";
cout<<"4"<<endl;
}
else
{
if(n%3==2)
{cout<<"2 ";
for(int i=0;i<m-1;i++)
cout<<"3 ";
cout<<"3"<<endl;
}
else
if(n%3==0)
{
for(int i=0;i<m-1;i++)
cout<<"3 ";
cout<<"3"<<endl;
}
}
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator