|
|
back to boardWA on #5,Why? Posted by pyh119 10 Dec 2006 20:26 #include "stdio.h" int main () { long n,total; long i,j; long zz; long a[1000];
scanf ("%ld",&n); for (i=1;i<=n;) { scanf ("%ld",&a[i]); if (a[i]%2!=0) i++; } for (i=1;i<=n;i++) for (j=i+1;j<=n;j++) if (a[i]>a[j]) { zz=a[j]; a[i]=a[j]; a[j]=zz; } total=0; for (i=1;i<=n/2+1;i++) total=total+a[i]/2+1; printf ("%ld",total); return (0); } Re: WA on #5,Why? zz=a[i]; !!! Edited by author 11.12.2006 19:25 Re: WA on #5,Why? Posted by pyh119 12 Dec 2006 17:11 Thank you very much,I've just had a silly wrong! |
|
|