acm经典百题
b1++; if(a[i]==0) else b3++; }}
else b2++; }
printf("%d %d %d\n",b1,b2,b3);
多项式求和#include<stdio.h> #include<math.h> { { { scanf("%lf",&n); for(j=1;j<=n;j++) s=s+1/j*pow(-1,j+1); printf("%.2lf\n",s); }} } main() double m,n,i,s,j,k,a; for(i=0;i<m;i++
) s=0;
偶数求和#include<stdio.h> { n,m,a,b,i,j,k,w,l,e,s,d,r; while(scanf("%d%d",&n,&m)!= EOF) e=0; if(n<=m) { ) { e=e+s; k=e/n; printf("%d\n",k); else { r=0; for(i=1;i<=n-w;i++) { l=l+s; if(i%m==0) { e=0; printf(" printf("%d",k); r=r+1; } if(w!=0) { ) { e=e+s; d=e-l; printf(" printf("%d",k); printf("\n"); }} s=s+2; } k=d/w; "); } } for(j=0;j<n;j++ } s=0; k=e/m; if(r) "); s=s+2; e=e+s; w=n%m; } } s=s+2; for(i=0;i<n;i++ { s=0; l=0; main() int
绝对值排序#include<stdio.h> { main() int
n,m,a[100],b[100],c,d,e,f,i,j,k; while(scanf("%d",&n)!=EOF& &n!=0) { f=0; { for(i=0;i<n;i++) { m=-a[i]; else if(c<=m) { b[j]=a[i]; k=i; } a[k]=0; printf(" printf("%d",b[j]); f=f+1; printf("\n"); }} } if(f) "); } c=m; m=a[i]; if(a[i]<0) for(i=0;i<n;i++) for(j=0;j<n;j++) c=0; scanf("%d",&a[i]);
while(scanf("%lf",&m)!=EOF)