头像

飞天猪




离线:2天前


活动打卡代码 AcWing 672. 税

#include<bits/stdc++.h>
using namespace std;
int main(){
    double n;
    cin>>n;
    if(n>=0&&n<=2000.0){
        cout<<"Isento"<<endl;
    }
    else if(n>2000&&n<=3000.0){
        printf("R$ %.2f",(n-2000)*0.08);
    }
    else if(n>3000&&n<=4500){
         printf("R$ %.2f", 1000*0.08+(n-3000)*0.18);
    }
    else if(n>4500.0){
        printf("R$ %.2f",350+(n-4500)*0.28);
    }

    return 0;
}



#include<bits/stdc++.h>
using namespace std;
int main(){
    double n;
    cin>>n;
    if(n>=0&&n<=2000.0){//注意不要在这里写局部变量,下同
        cout<<"Isento"<<endl;
    }
    else if(n>2000&&n<=3000.0){
        printf("R$ %.2f",(n-2000)*0.08);
    }
    else if(n>3000&&n<=4500){
         printf("R$ %.2f", 1000*0.08+(n-3000)*0.18);
    }
    else if(n>4500.0){
        printf("R$ %.2f",350+(n-4500)*0.28);
    }

    return 0;
}



#include<bits/stdc++.h>
using namespace std;

int main(){
    double A,B,C;
    double str[3] = {0};//设置输出形式为数组
    for(int i = 0;i<3;i++)cin>>str[i];
    sort(str,str+3);
    A = str[2];
    B = str[1];
    C = str[0];//对输入的字母进行从小到大排序


    if(A>=B+C){
        cout<<"NAO FORMA TRIANGULO"<<endl;
    }
    else{
        if(A*A == B*B+C*C){
            cout<<"TRIANGULO RETANGULO"<<endl;
        }
        if(A*A<B*B+C*C){
            cout<<"TRIANGULO ACUTANGULO"<<endl;
        }
        if(A*A>B*B+C*C){
            cout<<"TRIANGULO OBTUSANGULO"<<endl;
        }
        if(A == B&&B==C&&A==C){
            cout<<"TRIANGULO EQUILATERO"<<endl;
        }
        if(A==B&&B!=C||B==C&&C!=A||A==C&&A!=B){
            cout<<"TRIANGULO ISOSCELES"<<endl;
        }
    }
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;

int main(){
    double A,B,C;
    double str[3] = {0};
    for(int i = 0;i<3;i++)cin>>str[i];
    sort(str,str+3);
    A = str[2];
    B = str[1];
    C = str[0];


    if(A>=B+C){
        cout<<"NAO FORMA TRIANGULO"<<endl;
    }
    else{
        if(A*A == B*B+C*C){
            cout<<"TRIANGULO RETANGULO"<<endl;
        }
        if(A*A<B*B+C*C){
            cout<<"TRIANGULO ACUTANGULO"<<endl;
        }
        if(A*A>B*B+C*C){
            cout<<"TRIANGULO OBTUSANGULO"<<endl;
        }
        if(A == B&&B==C&&A==C){
            cout<<"TRIANGULO EQUILATERO"<<endl;
        }
        if(A==B&&B!=C||B==C&&C!=A||A==C&&A!=B){
            cout<<"TRIANGULO ISOSCELES"<<endl;
        }
    }
    return 0;
}



#include<bits/stdc++.h>
using namespace std;
int main(){
    double x,y;
    cin>>x>>y;
    if (x==0&&y==0){
        cout<<"Origem"<<endl;
    }
    else if (x<0&&y<0){
        cout<<"Q3"<<endl;
    }
    else if(x>0&&y<0){
        cout<<"Q4"<<endl;
    }
    else if(x<0&&y>0){
        cout<<"Q2"<<endl;
    }
    else if(x>0&&y>0){
        cout<<"Q1"<<endl;
    }
    else if(x==0&&y!=0){
        cout<<"Eixo Y"<<endl;
    }
    else if(y==0&&x!=0){
        cout<<"Eixo X"<<endl;
    }
    return 0;

}


活动打卡代码 AcWing 662. 点的坐标

#include<bits/stdc++.h>
using namespace std;
int main(){
    double x,y;
    cin>>x>>y;
    if (x==0&&y==0){
        cout<<"Origem"<<endl;
    }
    else if (x<0&&y<0){
        cout<<"Q3"<<endl;
    }
    else if(x>0&&y<0){
        cout<<"Q4"<<endl;
    }
    else if(x<0&&y>0){
        cout<<"Q2"<<endl;
    }
    else if(x>0&&y>0){
        cout<<"Q1"<<endl;
    }
    else if(x==0&&y!=0){
        cout<<"Eixo Y"<<endl;
    }
    else if(y==0&&x!=0){
        cout<<"Eixo X"<<endl;
    }
    return 0;

}


活动打卡代码 AcWing 671. DDD

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int x;
    cin >> x;
    if (x == 61) cout << "Brasilia" << endl;
    else if (x == 71) cout << "Salvador" << endl;
    else if (x == 11) cout << "Sao Paulo" << endl;
    else if (x == 21) cout << "Rio de Janeiro" << endl;
    else if (x == 32) cout << "Juiz de Fora" << endl;
    else if (x == 19) cout << "Campinas" << endl;
    else if (x == 27) cout << "Vitoria" << endl;
    else if (x == 31) cout << "Belo Horizonte" << endl;
    else cout << "DDD nao cadastrado" << endl;

    return 0;
}




#include<bits/stdc++.h>
using namespace std;
int main(){
    int A,B,C,D;
    cin>>A>>B>>C>>D;
    if(B>C &&D>A&&C+D>A+B && C>0&&D>0&&A%2==0){
        printf("Valores aceitos");

        }
        else{
            printf("Valores nao aceitos");
        }

    return 0;
}


活动打卡代码 AcWing 657. 选择练习1

#include<bits/stdc++.h>
using namespace std;
int main(){
    int A,B,C,D;
    cin>>A>>B>>C>>D;
    if(B>C &&D>A&&C+D>A+B && C>0&&D>0&&A%2==0){
        printf("Valores aceitos");

        }
        else{
            printf("Valores nao aceitos");
        }

    return 0;
}


活动打卡代码 AcWing 670. 动物

#include <iostream>

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 if(c == "onivoro") cout << "pomba" << endl;
        }

        if (b == "mamifero")
        {
            if (c == "onivoro") cout << "homem" << endl;
            else if (c == "herbivoro") cout << "vaca" <<endl;
        }
    }
    if (a == "invertebrado")
    {
        if (b == "inseto")
        {
            if (c == "hematofago") cout << "pulga" << endl;
            else if (c == "herbivoro") cout <<"lagarta" << endl;
        }
        if (b == "anelideo")
        {
            if (c == "hematofago") cout << "sanguessuga" << endl;
            else if (c == "onivoro") cout << "minhoca" << endl;
        }
    }
    return 0;
}