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

求帮忙:为什么会wa?

Posted by 2010014429 at 2011-10-06 11:35:59 on Problem 3903 and last updated at 2011-10-11 16:06:30
#include<stdio.h>
int main(){
    int n,sum,k,i;
    long x[100001];
    while(scanf("%d",&n)!=EOF){
                               if(n == 0){
                                    sum = 0;
                               }
                               else{
                               sum =1;
                               k = 1;
                               scanf("%ld",&x[0]);
                               for(i = 1;i<n;i++){
                                     scanf("%ld",&x[i]);
                                     if(x[i]>x[i-1]){
                                             k++;   
                                     }
                                     else if(x[i] == x[i-1]){
                                          continue;
                                     }
                                     else{
                                          k = 1;
                                     }
                                     if(sum<k){
                                                    sum = k;
                                     }
                               }
                               }
                               printf("%d\n",sum);
    }
                                          
}

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