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 |
求帮忙:为什么会wa?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator