| ||||||||||
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 |
????In Reply To:为什莫不过?? Posted by:3322 at 2004-12-20 17:21:23 > #include<stdio.h> > #include<math.h> > #include<malloc.h> > void main(){ > int n,i,k,j,p,s=0; > char *c; > scanf("%d\n",&n); > > c=(char *)malloc(sizeof(char)*n); > for(i=0;i<n;i++){ > scanf("%c",(c+i)); > } > for (k=48;k<=57;k++){ > for(p=0,j=0;j<n;j++){ > > if(*(c+j)==k) {p=p+1;} > } > if (p%2==1) s=s+1; > } > > for(k=65;k<=90;k++){ > for(p=0,j=0;j<n;j++){ > if(*(c+j)==k) p=p+1; > } > if (p%2==1) s=s+1; > } > > for(k=97;k<=122;k++){ > for(p=0,j=0;j<n;j++){ > if(*(c+j)==k) p=p+1; > } > if (p%2==1) s=s+1; > } > > if(s!=0) printf("%d\n",s-1); > else printf("0\n"); > > > > > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator