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:求帮忙:为什么会wa?

Posted by sanpin at 2011-11-01 21:54:15 on Problem 3903
In Reply To:求帮忙:为什么会wa? Posted by:2010014429 at 2011-10-06 11:35:59
> #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