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

为什么会出错啊?哪位大哥指教一下

Posted by piky at 2005-02-15 21:53:26 on Problem 2039
#include <iostream>


using namespace std;

int main(int argc, char *argv[])
{
  int s;
  cin>>s;
  int l,h;
  while(s<=20&&s>=2)
  {
   char a[2001],b[200][200];
   l=0;
   for(int i=0;i<2001;i++)a[i]=-1;
   cin>>a;
   for(int i=0;a[i]!='\0';i++)
   {
       l++;
       
   } 
   h=l/s;
   for(int i=0;i<s;i++)
   for(int j=0;j<h;j++)   
   {
    cout<<a[j*s+i];
   }    
   cin>>s;
      
      
  }    

  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