exhausted吧 关注:3贴子:431
  • 1回复贴,共1
#include <stdio.h>
void main()
{
     int x,a;
     float y;
     scanf("%d",&x);
     a=x/15;
     switch(a)
     {
     case 0: y=40.0/15.0*x+10;printf("y=%f",y);break;
     case 1: y=50;printf("y=%f",y);break;
     case 2: y=50-10.0/15.0*(x-30);printf("y=%f",y);break;
     case 3:
     case 4: y=40+20.0/30.0*(x-45);printf("y=%f",y);break;
     case 5: y=60-10.0/15.0*(x-75);printf("y=%f",y);break;
     default:printf("no meaning\n");
     }
}


IP属地:福建1楼2010-03-29 17:11回复
    #include <stdio.h>
    void main()
    {
         double n,a,b;
         scanf("%lf",&n);
         b=n;
         while (b>=2)
         {
             a=b-1;
             n=n*a;
             b=a;
         }
         printf("%f\n",n);
    }


    IP属地:福建2楼2010-03-29 17:12
    回复