#include<stdio.h>#include<stdlib.h>#include<math.h>double pow(double, double);int main(){ float x; printf("please input number : "); while(scanf("%f",&x)==1) { printf("%f\n",pow(2,x)); } return 0;}
//如何消去小數點呢?但是pow又必需配合用%f
#include#include#includedouble pow(double, double);int main(){ float x; printf("please input number : "); while(scanf("%f",&x)==1) { printf("%.f\n",pow(2,x)); } return 0;}