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

请求各位前辈了,可以帮我看看哪有错吗?我已经不行了,我用DEV-C++带数据进去是对的,求求你们了

Posted by Selfind at 2007-10-27 00:36:44 on Problem 1007
#include <iostream>

using namespace std;

int main()
{   int a,b;
    cin >> a >> b;
    char DNA[100][50];
    
    for(int n=0;n<b;n++) 
    {
            for(int m=0;m<a;m++)
            {
                    cin>>DNA[n][m];
            }
    }
    
    int x[100];
    int loop;
    for(loop=0;loop<=49;loop++)
    x[loop]=0;
    
    for(int n=0;n<b;n++)
    {
                    for(int m=0;m<a;m++)
                    {
                                    for(int r=m;r<a;r++)
                                    {
                                            if(DNA[n][r]<DNA[n][m])
                                            x[n]++;
                                    }
                    }
    }
    for(int w=0;w<=(a*(a-1))/2;w++)
    {
            for(int n=0;n<b;n++)
            {
               if(x[n]==w)
               {
                          for(int m=0;m<a;m++)
                          {
                          cout<<DNA[n][m];
                          }
                          cout<<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