头像

Atopo




离线:26分钟前


最近来访(89)
用户头像
然然许的什么愿
用户头像
艾伦_2
用户头像
甜菜丘
用户头像
Curtain_67
用户头像
asbefore...
用户头像
满洲里有象QAQ
用户头像
俞睿
用户头像
逆陽の葵
用户头像
顽童
用户头像
y_yy
用户头像
仙贝
用户头像
嘉心糖今天学算法
用户头像
雾璃鸦
用户头像
BT7274
用户头像
こんにちは
用户头像
半.透明.
用户头像
乐子人_3
用户头像
Titanium_0
用户头像
歌姬葛平
用户头像
小huohuo

活动打卡代码 AcWing 663. 简单排序

Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

int main()
{
    int a, b, c;
    cin >> a >> b >> c;

    int x = a, y = b, z = c;

    if (b < a)
    {
        int t = a;
        a = b;
        b = t;
    }
    if (c < a)
    {
        int t = a;
        a = c;
        c = t;
    }
    if (c < b)
    {
        int t = b;
        b = c;
        c = t;
    }

    cout << a << endl << b << endl << c << endl << endl;
    cout << x << endl << y << endl << z << endl;

    return 0;
}


活动打卡代码 AcWing 672. 税

Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std ;

int main()
{
    double x;
    scanf("%lf", &x);

    double sum = 0;
    if (x > 2000)
    {
        double y = 3000;
        if (x < 3000) y = x;
        sum += (y - 2000) * 0.08;
    }
    if (x > 3000)
    {
        double y = 4500;
        if (x < 4500) y = x;
        sum += (y - 3000) * 0.18;
    }
    if (x > 4500) sum += (x - 4500) * 0.28;

    if (sum == 0) printf("Isento");
    else printf("R$ %.2lf\n", sum);

    return 0;
}


活动打卡代码 AcWing 668. 游戏时间2

Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std ;

int a , b , c , d ;

int main()
{
    scanf("%d%d%d%d", &a, &b, &c, &d);

    int start = a * 60 + b;
    int end = c * 60 + d;

    int spent_time = end - start;
    if (spent_time <= 0) spent_time += 1440;

    printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)", spent_time / 60, spent_time % 60);

    return 0;
}


活动打卡代码 AcWing 666. 三角形类型

Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>

using namespace std ;

double a , b , c ;
vector<double>nums ;

int main ()
{
    for (int i = 0 ; i < 3 ; i++){
        int num ;
        cin >> num ;
        nums.push_back(num) ;
    }

    sort (nums.begin() , nums.end()) ;

    a = nums[2] ;
    b = nums[1] ;
    c = nums[0] ;

    cout << a << "  " << b << "  " << c << endl ;

    if (a >= b + c){
        cout << "NAO FORMA TRIANGULO\n" ;
    }else{
        if (a * a == b * b + c * c){
            cout << "TRIANGULO RETANGULO\n" ;
        }else if (a * a < b * b + c * c){
            cout << "TRIANGULO ACUTANGULO\n" ;
        }else {
            cout << "TRIANGULO OBTUSANGULO\n";
        }
        if (a == b && b == c){
            cout << "TRIANGULO EQUILATERO\n" ;
        }else if (b == c && a != b){
            cout << "TRIANGULO ISOSCELES\n" ;
        }else if (a == b &&  a != c){
            cout << "TRIANGULO ISOSCELES\n" ;
        }
    }

    return 0 ;
}


活动打卡代码 AcWing 670. 动物

Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

int main()
{
    string a, b, c;
    cin >> a >> b >> c;

    if (a == "vertebrado")
    {
        if (b == "ave")
        {
            if (c == "carnivoro") cout << "aguia" << endl;
            else cout << "pomba" << endl;
        }
        else
        {
            if (c == "onivoro") cout << "homem" << endl;
            else cout << "vaca" << endl;
        }
    }
    else
    {
        if (b == "inseto")
        {
            if (c == "hematofago") cout << "pulga" << endl;
            else cout << "lagarta" << endl;
        }
        else
        {
            if (c == "hematofago") cout << "sanguessuga" << endl;
            else cout << "minhoca" << endl;
        }
    }

    return 0;
}


活动打卡代码 AcWing 669. 加薪

Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std ;

int main()
{
    double salary;
    scanf("%lf", &salary);

    double x;

    if (salary <= 400) x = 0.15;
    else if (salary <= 800) x = 0.12;
    else if (salary <= 1200) x = 0.1;
    else if (salary <= 2000) x = 0.07;
    else x = 0.04;

    printf("Novo salario: %.2lf\n", salary * (1 + x));
    printf("Reajuste ganho: %.2lf\n", salary * x);
    printf("Em percentual: %.0lf %%", x * 100);

    return 0;
}


活动打卡代码 AcWing 667. 游戏时间

Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std ;

int a, b ;

int main ()
{
    cin >> a >> b ;

    if ( b > a){
        printf ("O JOGO DUROU %d HORA(S)" , b - a) ;
    }else if (b == a){
        printf ("O JOGO DUROU %d HORA(S)" , 24) ;
    }else {
        printf ("O JOGO DUROU %d HORA(S)" , 24 - a + b) ;
    }

    return 0 ;
}



Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std ;

int a, b ;

int main ()
{
    cin >> a >> b ;

    if ( b > a){
        printf ("O JOGO DUROU %d HORA(S)" , b - a) ;
    }else if (b == a){
        printf ("O JOGO DUROU %d HORA(S)" , 24) ;
    }else {
        printf ("O JOGO DUROU %d HORA(S)" , 24 - a + b) ;
    }

    return 0 ;
}


活动打卡代码 AcWing 659. 区间

Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std ;

double a ;

int main ()
{
    cin >> a ;

    if (a >=0 && a <= 25){
        cout << "Intervalo [0,25]" << endl ;
    }else if (a > 25 && a <= 50){
        cout << "Intervalo (25,50]" << endl ;
    }else if (a > 50 && a <= 75){
        cout << "Intervalo (50,75]" << endl ;
    }else if (a > 75 && a <= 100){
        cout << "Intervalo (75,100]" << endl ;
    }else {
        cout << "Fora de intervalo" << endl; 
    }

    return 0 ;
}



Atopo
5天前
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std ;

double a ;

int main ()
{
    cin >> a ;

    if (a >=0 && a <= 25){
        cout << "Intervalo [0,25]" << endl ;
    }else if (a > 25 && a <= 50){
        cout << "Intervalo (25,50]" << endl ;
    }else if (a > 50 && a <= 75){
        cout << "Intervalo (50,75]" << endl ;
    }else if (a > 75 && a <= 100){
        cout << "Intervalo (75,100]" << endl ;
    }else {
        cout << "Fora de intervalo" << endl; 
    }

    return 0 ;
}