#includeint main(){int n,i,a,sum=0;printf("你想输入几个数:"); scanf("%d",&n);for(i=1;i<=n;i++){ printf("请输入第%d个数:",i); scanf("%d",&a); if(a%2!=0) sum=sum+a;}if(sum==0) printf("这些数中没有奇数");else printf("这%d个数中所有奇数的和为:%d",n,sum);return 0;}
#includedouble mypow(){ double x,a=1; int n,i; printf("请依次输入x和n的值:"); scanf("%lf %d",&x,&n); for(i=1;i<=n;i++) a=a*x; printf("%.2f的%d次方为:%.2f",x,n,a);}int main(){ mypow(); return 0;}
#include#define Pi 3.14double cylinder(){ double r,height,v; printf("请输入这个圆柱的半径和高:"); scanf("%lf %lf",&r,&height); v=Pi*r*r*height; printf("这个圆柱的体积为:%.3f",v); }int main(){ cylinder(); return 0;}