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

why 1032 wrong answer, I think it is right.???

Posted by beikeaeiou at 2010-12-28 04:54:49
#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:
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