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 |
这样就好了In Reply To:请求各位前辈了,可以帮我看看哪有错吗?我已经不行了,我用DEV-C++带数据进去是对的,求求你们了 Posted by:Selfind at 2007-10-27 00:36:44 这样就过了 #include <iostream> using namespace std; int main() { int a,b; cin >> a >> b; char DNA[b][a]; //原来是 char DNA[100][50]; for(int n=0;n<b;n++) { for(int m=0;m<a;m++) { cin>>DNA[n][m]; } } int x[b]; //原来是 int x[100]; int loop; for(loop=0;loop<=b-1;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; } } } system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator