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 |
为什么我的程序老是出现Runtime error?快疯了!!!求助ing#include <iostream> using namespace std; #define INFY 10000 int main() { int k,t,tep,m,n,flag,minnum,i,j,b[51]; char a[51][101]; cin>>m>>n; for(i=0;i<n;i++) for(j=0;j<m;j++) cin>>a[i][j]; for(i=0;i<n;i++) { t=0; for(j=0;j<m;j++) { k=j-1; flag=1; while(flag) { k++; if(a[i][j]>a[i][k]) t++; if(k==m-1) flag=0; } } b[i]=t; } for(j=0;j<n;j++) { tep=-1; minnum=INFY; for(i=0;i<n;i++) { if(minnum>b[i]) { minnum=b[i]; tep=i; } } for(i=0;i<m;i++) cout<<a[tep][i]; cout<<endl; b[tep]=INFY; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator