a+b问题与圆柱体表面积的计算


a+b problem


#include<stdio.h> int main() { int a,b; scanf("%d %d",&a,&b);//读入int整形变量a和b,不可缺少& printf("%d",a+b); return 0; }

计算圆柱体面积:

#include<stdio.h>
#include<math.h>
int main()
{
    const double pi=acos(-1.0);
    double r,h,s1,s2,s;
       scanf("%lf %lf",&r,&h);
       s1=pi*r*r;
       s2=2*pi*r*h;
       s=s1*2+s2;
    printf("%.3lf",s);
    return 0;
    }

 

posted @ 2014-08-01 01:14  z52527  阅读(135)  评论(0编辑  收藏  举报