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

Re:晒下代码,很复杂,但是肯定易懂

Posted by 773428763 at 2010-10-12 17:30:03 on Problem 1007
In Reply To:晒下代码,很复杂,但是肯定易懂 Posted by:lovemj at 2010-08-10 15:54:29
> #include <cstdlib>
> #include <iostream>
> #include <string>
> using namespace std;
> 
> int main(int argc, char *argv[])
> {
>     int n,m,measure[100]={0};
>     cin>>n>>m;
>     string *s = new string[100];
>     int i,j=0,k;
>     for(i=0;i<m;i++)
>     {
>         cin>>s[i];
>     }
>     
>     for(i=0;i<m;i++)
>     {
>         for(j=0;j<n;j++)
>         {
>             for(k=j;k<n;k++)
>             {
>                 if((int)s[i][j]>(int)s[i][k])
>                     measure[i]++;
>             }
>         }
>     }
>   /*  for(i=0;i<m;i++)
>         cout<<measure[i]<<endl;  */
>     for(j=0;j<m;j++)
>     {
>         int sign=j,t=measure[j];
>         for(i=0;i<m;i++)
>         {
>             if(measure[i]<t)
>             {
>                 t=measure[i];
>                 sign = i;
>             } 
>         }
>         measure[sign]= 50000;
>         cout<<s[sign]<<endl;
>     }
>         
>     system("PAUSE");
>     return EXIT_SUCCESS;
> }

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