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 |
为什么还是错?#include <stdio.h> int main(void) { int T, n, i, m, j, count, k; int s[200], t[200], cr[200]; FILE *fp; fp = fopen("1083.txt","r"); fscanf(fp,"%d", &T); for(m=1; m<=T; m++) { fscanf(fp,"%d", &n); for(i=1; i<=200; i++) cr[i] = 0; for(j=1; j<=n; j++) { fscanf(fp,"%d%d", &s[j], &t[j]); //输入N次 if(s[j] % 2) s[j]++; if(t[j] % 2) t[j]++; s[j] /=2; t[j] /=2; if(s[j]>t[j]) { int temp; temp = s[j]; s[j] = t[j]; t[j] = temp; } for(k=s[j]; k<=t[j];k++) { cr[k]++; } } count = cr[1]; for(i=1; i<=200; i++) { if(cr[i]>count) { count = cr[i]; } } printf("%d\n", count*10); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator