头像

legendbc




离线:8天前


活动打卡代码 AcWing 611. 简单计算

#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
    int a1,b1;
    int a2,b2;
    double c1,c2;
    cin >> a1 >> b1 >> c1;
    cin >> a2 >> b2 >> c2;
    printf("VALOR A PAGAR: R$ %.2lf", (b1*c1 + b2*c2));
    return 0;
}


活动打卡代码 AcWing 605. 简单乘积

#include <iostream>
using namespace std;

int main()
{
    int m,n;
    // int res;
    cin >> m >> n;
    cout <<"PROD = " << m*n << endl;
    return 0;
}


活动打卡代码 AcWing 654. 时间转换

#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
    int n,hour = 0,min = 0,sec = 0;
    scanf("%d",&n);
    hour = n /(60*60);
    n = n - hour * (60*60);
    min = n /60;
    n = n - min * 60;
    sec = n;
    printf("%d:%d:%d",hour,min,sec);
    return 0;

}


活动打卡代码 AcWing 653. 钞票

#include <iostream>
#include <cstdio>
using namespace std;

const int SIZE = 7;
int q[SIZE] = {100,50,20,10,5,2,1};

int main()
{
    int N;
    scanf("%d", &N);
    int tmp = N;
    printf("%d\n",tmp);
    for(int i = 0; i < SIZE; i++)
    {
        int res = tmp / q[i];
        tmp = tmp - res * q[i];
        printf("%d nota(s) de R$ %d,00\n",res,q[i]);
    }
    return 0;
}


活动打卡代码 AcWing 616. 两点间的距离

#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    double x1,y1,x2,y2;
    double res;
    cin >> x1 >> y1 >> x2 >> y2;
    printf("%.4lf", sqrt((x1-x2) * (x1 - x2) + (y1 -y2) *(y1 - y2)));
    return 0;
}


活动打卡代码 AcWing 615. 油耗

#include<iostream>
#include<cstdio>
using namespace std;

int main()
{
    int x;
    double y;
    scanf("%d %lf", &x, &y);
    double m = double(x) / y;
    printf("%.3f km/l",m);
    return 0;
}


活动打卡代码 AcWing 609. 工资

legendbc
13天前
#include<cstdio>
using namespace std;

int main()
{
    int l, m;
    double n;
    scanf("%d %d %lf", &l, &m, &n);
    printf("NUMBER = %d\n", l);
    printf("SALARY = U$ %.2lf", n*m);
    return 0;
}


活动打卡代码 AcWing 606. 平均数1

legendbc
13天前
#include <iostream>
using namespace std;

int main()
{
    double a_weight = 3.5, b_weight = 7.5;
    double a,b;
    cin >> a >> b;
    printf("MEDIA = %.5f", (a_weight*a + b_weight*b)/(a_weight+b_weight));
}


活动打卡代码 AcWing 604. 圆的面积

legendbc
13天前
#include <iostream>
using namespace std;
const double pi = 3.14159;

int main()
{
    double r;
    cin >> r;
    printf("A=%.4f", pi*r*r);
    return 0;
}


活动打卡代码 AcWing 608. 差

legendbc
13天前
#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;
}