1、 1 3-3-1 #include void main() int x,a,b,c; scanf(“%d“, a=x%10; b=x/10%10; c=x/100; x=a*100+b*10+c; printf(“%dn“,x); 4-3-2 #include void main() int a,b,c,d,t; scanf(“%d%d%d%d“, if(ab)t=a;a=b;b=t; if(ac)t=a;a=c;c=t; if(ad)t=a;a=d;d=t; if(bc)t=b;b=c;c=t; 2 if(bd)t=b;b=d;d=t; if(cd)t=c;c=d;d=t; printf(“
2、%d,%d,%d,%dn“,a,b,c,d); 4-3-3 #include #include void main() double a,b,c,t,x1,x2; printf(“input a,b,c:n“); scanf(“%lf%lf%lf“, t=b*b-4*a*c; if(t0) x1=(-b+sqrt(t)/(2*a); x2=(-b-sqrt(t)/(2*a); printf(“x1=%.3f,x2=%.3fn“,x1,x2); if(t=0) x1=-b/(2*a); 3 printf(“x1=x2=%.3f/n“,x1); 5-3-1 #include void main()
3、 int i; double s,h; s=100;h=100; for(i=1;i void main() int i; 4 double f=1,s=0; for(i=1;i void main() int i,a,b,c; for(i=100;i void main() int i,n,f; for(i=1;i void main() long f1,f2,f3,i,m,n,y; 6 f1=1;f2=1;f3=1; scanf(“%d%d“, for(i=1;i void main() double a,b,t,sum=0; int i,s=1; a=1;b=2; for(i=1;i #
4、include void main() double x,xn,fac,cosx; int n,s; fac=s=1;n=0; scanf(“%lf“, xn=cosx=1; do s=-s; n=n+2; fac=fac*n*(n-1); xn=xn*x*x; cosx=cosx+s*xn/fac; while(fabs(xn/fac)0.0001); printf(“%lf,%lfn“,cosx,cos(x); 6-3-1 #include 8 double fun(double); void main() double x,y; scanf(“%lf“, y=fun(x); printf(“y=%lfn“,y); double fun(double x) double y; if(x int fun(int); 9 void main() int i,a; for(i=1;i int fun(int); void main() int m,n,p,q; scanf(“%d%d“, p=fun(n); q=fun(n-m+1); printf(“%dn“,p/q); int fun(int n) int p,i; for(p=1,i=1;i double fun(int); void main()