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 |
1083 runtime error 始终过不去、求原因、、#include <iostream> using namespace std; void ad(int *p,int m,int n) { int t; if(m > n) { t = m; m = n; n = t; } while(m <= n) { p[m]++; m++; } } void zero(int * p) { int i ; for( i = 0;i < 201;i++) p[i] = 0; } int main() { int * a = new int[201](); int * b; int c; int d; int i,j,k,t = 0; int ii; zero(a); cin >> i; ii = i; b = new int [i]; while(i--) { cin >> j; while(j--) { scanf("%d %d",&c,&d); ad(a,c,d); } for(k = 1;k < 201;k++) { if(t < a[k]) t = a[k]; } b[i] = t * 10; t = 0; zero(a); } while(ii--) cout << b[ii] << endl; return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator