习题2.2

#include<stdio.h>

int main(void)

{

         int kwh;

         double free;

 

         printf("Enter kwh:");

         scanf("%d",&kwh);

 

         if(kwh<=50){

                   free=0.53*kwh;

        

         printf("%.2f\n",free);

         }

         else{

                   free=0.53*50+0.58*(free-50);

        

         printf("%.2f\n",free);

         }

         return 0;

}

posted @ 2013-10-19 00:17  zhaoyang16  阅读(98)  评论(0编辑  收藏  举报