| ||||||||||
| 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 | |||||||||
Re:请问,这代码错在哪啊,忘牛人指点In Reply To:请问,这代码错在哪啊,忘牛人指点 Posted by:nwpu_ghost at 2006-09-24 21:27:50 > #include "stdio.h"
> #include "stdlib.h"
> #define N 1001
> int main(){
>
> int test;
> int i=0,n,k,j=0;
> int x[N];
> int a,b;char c;
> scanf("%d",&test);
> for(i=0;i<test;i++) {
> for(j=0;j<N;j++) x[j]=0;
> scanf("%d",&n);fflush(stdin);
> for(j=0;j<n;j++) {
> fflush(stdin);
> scanf("%c%d%d",&c,&a,&b);
> for(k=a;k<b;k++)
> x[k]=x[k]+1;
> }
> for(j=0;j<N;j++)
> if(x[j]>0)
> printf("%c",'A'+x[j]-1);
> printf("\n");
> }
> return 0;
> }
不好意思,已经过了,是fflush(stdin) 的问题
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator