acming 语法基础week 1全部练习题代码

604.

#include <cstdio>

#define pi 3.14159

int main()
{
double R;
scanf(“%lf”,&R);
double A;
A = pi * R * R;
printf(“A=%.4lf”, A);
return 0;

}

605.

#include <cstdio>
#include <iostream>
using namespace std;
int main()
{   int a,b;
    scanf("%d %d",&a,&b);
    printf("PROD = %d",a*b);
    return 0;
}

606.

#include <cstdio>
int main()
{    double A,B;
     scanf("%lf %lf",&A,&B);
     printf("MEDIA = %.5lf",(A*3.5+B*7.5)/11);
     return 0;
}

607.

#include <cstdio>
int main()
{   
     double A,B,C;
     scanf("%lf %lf %lf",&A,&B,&C);
     printf("MEDIA = %.1lf",(A*2+B*3+C*5)/10);
     return 0;
}

608.

#include <cstdio>
using namespace std;
int main()
{  int A,B,C,D;
   scanf("%d%d%d%d",&A,&B,&C,&D);
   printf("DIFERENCA = %d",A*B-C*D);
   return 0;
}

609.

#include <cstdio>
using namespace std;
int main()
{  int A,B;
   scanf("%d %d",&A,&B);
   printf("NUMBER = %d\n",A);
   double C;
   scanf("%lf",&C);
   printf("SALARY = U$ %.2f",B*C);
   return 0;
}

610.

#include<cstdio>
int main()
{
    char a[10];
    float c, b;
    scanf("%s %f %f ",&a,&c, &b);
    printf("TOTAL = R$ %.2f", c + b * 0.15);
   return 0;
}

611.

#include <cstdio>
int main()
{
    int a,b;
    double c;
    scanf("%d %d %lf",&a,&b,&c);
    int a1,b1;
    double c1;
    scanf("%d %d %lf",&a1,&b1,&c1);
    printf("VALOR A PAGAR: R$ %.2lf",b*c+b1*c1);
    return 0;
}

612.

#include <cstdio>
#define pi 3.14159
using namespace std;
int main ()
{
   double R;
    scanf("%lf",&R);
    printf("VOLUME = %.3f",(4/3.0)*pi*R*R*R);
    return 0;
}

613.

#include <cstdio>
int main()
{
    double A ,B,C;
    scanf("%lf %lf %lf",&A,&B,&C);
    printf("TRIANGULO: %.3lf\n",A*C/2);
    printf("CIRCULO: %.3lf\n",C*C*3.14159);
    printf("TRAPEZIO: %.3lf\n",(A+B)*C/2);
    printf("QUADRADO: %.3lf\n",B*B);
    printf("RETANGULO: %.3lf\n",A*B);
    
}

614.

#include <cstdio>
int main ()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(a>b&&a>c){
        printf("%d eh o maior",a);
    }else if(b>a&&b>c){
        printf("%d eh o maior",b);
    }else{
        printf("%d eh o maior",c);
    }
    return 0;
}

615.

#include <cstdio>
int main ()
{
   int a;
   double b;
   scanf("%d %lf",&a,&b);
   printf("%.3f km/l",a/b);
   return 0;
}

616.

#include <cstdio>
#include <cmath> 
int main ()
{
    double x1,y1,x2,y2;
    scanf("%lf %lf\n",&x1,&y1);
    scanf("%lf %lf\n",&x2,&y2);
    printf("%.4lf",sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)));
    return 0;
}

617.

#include <cstdio>
int main()
{
    int L;
    scanf("%d",&L);
    printf("%d minutos",2*L);
    return 0;
}

618.

include <cstdio>
int main ()
{
    double T,S;
    scanf("%lf %lf",&T,&S);
    printf("%.3lf",T*S/12);
    return 0;
}

  • 25
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值