acwing C语言 week 2

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

int main()
{
                                /* 653.
                                        int N;
                                        scanf("%d", &N);
                                        printf("%d\n", N);
                                        int n100, n50, n20, n10, n5, n2, n1;
                                        n100 = N / 100;
                                        N %= 100;
                                        n50 = N / 50;
                                        N %= 50;
                                        n20 = N / 20;
                                        N %= 20;
                                        n10 = N / 10;
                                        N %= 10;
                                        n5 = N / 5;
                                        N %= 5;
                                        n2 = N / 2;
                                        N %= 2;
                                        n1 = N / 1;
                                        N %= 1;
                                        printf("%d nota(s) de R$ 100,00\n", n100);
                                        printf("%d nota(s) de R$ 50,00\n", n50);
                                        printf("%d nota(s) de R$ 20,00\n", n20);
                                        printf("%d nota(s) de R$ 10,00\n", n10);
                                        printf("%d nota(s) de R$ 5,00\n", n5);
                                        printf("%d nota(s) de R$ 2,00\n", n2);
                                        printf("%d nota(s) de R$ 1,00\n", n1);

                                  654.
                                        int N;
                                        scanf("%d", &N);
                                        int h, f;
                                        h = N / 3600;
                                        N %= 3600;
                                        f = N / 60;
                                        N %= 60;
                                        printf("%d:%d:%d", h, f, N);
      
                                   655.
                                       int day;
                                        scanf("%d", &day);
                                        int year, month;
                                        year = day / 365;
                                        day %= 365;
                                        month = day / 30;
                                        day %= 30;
                                        printf("%d ano(s)\n", year);
                                        printf("%d mes(es)\n", month);
                                        printf("%d dia(s)\n", day);
                                    656.
                                       double N;
                                        scanf("%lf", &N);
                                        int n = N * 100;
                                        printf("NOTAS:\n");
                                        printf("%d nota(s) de R$ 100.00\n", n / 10000);
                                        n %= 10000;
                                        printf("%d nota(s) de R$ 50.00\n", n / 5000);
                                        n %= 5000;
                                        printf("%d nota(s) de R$ 20.00\n", n / 2000);
                                        n %= 2000;
                                        printf("%d nota(s) de R$ 10.00\n", n / 1000);
                                        n %= 1000;
                                        printf("%d nota(s) de R$ 5.00\n", n / 500);
                                        n %= 500;
                                        printf("%d nota(s) de R$ 2.00\n", n / 200);
                                        n %= 200;
                                        printf("MOEDAS:\n");
                                        printf("%d moeda(s) de R$ 1.00\n", n / 100);
                                        n %= 100;
                                        printf("%d moeda(s) de R$ 0.50\n", n / 50);
                                        n %= 50;
                                        printf("%d moeda(s) de R$ 0.25\n", n / 25);
                                        n %= 25;
                                        printf("%d moeda(s) de R$ 0.10\n", n / 10);
                                        n %= 10;
                                        printf("%d moeda(s) de R$ 0.05\n", n / 5);
                                        n %= 5;
                                        printf("%d moeda(s) de R$ 0.01\n", n / 1);
                                    657.
                                        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)
                                        {
                                            cout << "Valores aceitos" << endl;
                                        }
                                        else
                                        {
                                            cout << "Valores nao aceitos" << endl;
                                        }
   
    
                                           658.
                                               float a, b, c, d, f;
                                                cin >> a >> b >> c;
                                                d = sqrt(b * b - 4 * a * c);
                                                f = (b * b) - (4 * a * c);
                                                if (f < 0 || a == 0)
                                                {
                                                    cout << "Impossivel calcular" << endl;
                                                }
                                                else
                                                {
                                                    double x1 = (-b - d) / (2 * a);
                                                    double x2 = (-b + d) / (2 * a);
                                                    printf("R1 = %.5f\n", x1);
                                                    printf("R1 = %.5f", x2);
                                                }
       
                                    659.
                                        float a;
                                        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;
          
                                    660.
                                        int x;
                                        float y;
                                        cin >> x >> y;
                                        if (x == 1)
                                        {
                                            cout << "Total: R$ " << fixed << setprecision(2) << 4.00 * y << endl;
                                        }
                                        else if (x == 2)
                                        {
                                            cout << "Total: R$ " << fixed << setprecision(2) << 4.50 * y << endl;
                                        }
                                        else if (x == 3)
                                        {
                                            cout << "Total: R$ " << fixed << setprecision(2) << 5.00 * y << endl;
                                        }
                                        else if (x == 4)
                                        {
                                            cout << "Total: R$ " << fixed << setprecision(2) << 2.00 * y << endl;
                                        }
                                        else if (x == 5)
                                        {
                                            cout << "Total: R$ " << fixed << setprecision(2) << 1.50 * y << endl;
                                        }
                                      661.
                                            float a, b, c, d;
                                            scanf("%f %f %f %f", &a, &b, &c, &d);
                                            float e = (a * 2 + b * 3 + c * 4 + d) / 10;
                                            printf("Media: %.1f\n", e);
                                            if (e >= 7.0)
                                            {
                                                printf("Aluno aprovado.\n");
                                            }
                                            else if (e < 5.0)
                                            {
                                                printf("Aluno reprovado.\n");
                                            }
                                            else if (e >= 5.0 && e < 7.0)
                                            {
                                                printf("Aluno em exame.\n");
                                                float y;
                                                scanf("%f", &y);
                                                printf("Nota do exame:%.1f\n", y);
                                                if ((e + y) / 2 >= 5)
                                                {
                                                    printf("Aluno aprovado.\n");
                                                }
                                                else
                                                {
                                                    printf("Aluno reprovado.\n");
                                                }
                                                printf("Media final: %.1f\n", (e + y) / 2);
                                            }
                                    662.
                                        float x, y;
                                        cin >> x >> y;
                                        if (x > 0 && y > 0)
                                        {
                                            cout << "Q1" << endl;
                                        }
                                        else if (x < 0 && y>0)
                                        {
                                            cout << "Q2" << endl;
                                        }
                                        else if (x > 0 && y < 0)
                                        {
                                            cout << "Q4" << endl;
                                        }
                                        else if (x < 0 && y < 0)
                                        {
                                            cout << "Q3" << endl;
                                        }
                                        else if (x == 0 && y != 0)
                                        {
                                            cout << "Eixo Y" << endl;
                                        }
                                        else if (y == 0 && x != 0)
                                        {
                                            cout << "Eixo X" << endl;
                                        }
                                        else if (x == 0 && y == 0)
                                        {
                                            cout << "Origem" << endl;
                                        }
                                    663.                      
                                        int a, b, c;
                                        cin >> a >> b >> c;
                                        if (a > b && a > c)
                                        {
                                            if (b > c)
                                            {
                                                printf("%d\n%d\n%d\n\n", c, b, a);
                                                printf("%d\n%d\n%d\n", a, b, c);

                                            }
                                            else if (c > b)
                                            {
                                                printf("%d\n%d\n%d\n\n", b, c, a);
                                                printf("%d\n%d\n%d\n", a, b, c);

                                            }
                                        }
                                        else if (c > a && c > b)
                                        {
                                            if (a > b)
                                            {
                                                printf("%d\n%d\n%d\n\n", b, a, c);
                                                printf("%d\n%d\n%d\n", a, b, c);

                                            }

                                            else if (b > a)
                                            {
                                                printf("%d\n%d\n%d\n\n", a, b, c);
                                                printf("%d\n%d\n%d\n", a, b, c);

                                            }
                                        }
                                        else if (b > a && b > c)
                                        {
                                            if (a > c)
                                            {
                                                printf("%d\n%d\n%d\n\n", c, a, b);
                                                printf("%d\n%d\n%d\n", a, b, c);

                                            }
                                            else if (c > a)
                                            {
                                                printf("%d\n%d\n%d\n\n", a, c, b);
                                                printf("%d\n%d\n%d\n", a, b, c);

                                            }
                                        }
                                    664.
                                        float a, b, c;
                                        cin >> a >> b >> c;
                                        if (a + b > c && a + c > b && b + c > a)
                                        {
                                            cout << "Perimetro = " << a + b + c << endl;
                                        }
                                        else
                                        {
                                            cout << "Area = " << fixed << setprecision(1) << (a + b) * c / 2 << endl;
                                        }
                                    665.
                                        int a, b;
                                        cin >> a >> b;
                                        if (a % b == 0 || b % a == 0)
                                         {
                                                cout << "Sao Multiplos" << endl;
                                         }
                                         else
                                         {
                                                cout << "Nao sao Multiplos" << endl;
                                         }
                                    666.

                                        double a, b, c;
                                        cin >> a >> b >> c;
                                        if(a < b)swap(a, b);
                                        if (a < c)swap(a, c);
                                        if (b < c)swap(b, c);
                                        if (a >= b + c)
                                        {
                                            cout << "NAO FORMA TRIANGULO" << endl;
                                            return 0;
                                        }
                                        if (a * a == b * b + c * c)
                                        {
                                            cout << "TRIANGULO RETANGULO" << endl;
                                        }
                                        if (a * a > b * b + c * c)
                                        {
                                            cout << "TRIANGULO OBTUSANGULO" << endl;
                                        }
                                        if (a * a < b * b + c * c)
                                        {
                                            cout << "TRIANGULO ACUTANGULO" << endl;
                                        }
                                        if (a * a == b * b && b * b == c * c)
                                        {
                                            cout << "TRIANGULO EQUILATERO" << endl;
                                        }
                                        if (a == b && b != c || b == c && a != b)
                                        {
                                            cout << "TRIANGULO ISOSCELES" << endl;
                                        }*/

   
   
        return 0;
    
}

  • 13
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值