头像

Lina_6




离线:9小时前


最近来访(2)
用户头像
null_luo
用户头像
Skuy

活动打卡代码 AcWing 656. 钞票和硬币

Lina_6
9小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double n = sc.nextDouble();
        n += 1e-8;
        int cnt = (int)(n / 100);
        n -= cnt * 100;
        System.out.println("NOTAS:");
        System.out.printf("%d nota(s) de R$ %.2f\n",cnt, 100.0);
        cnt = (int)(n / 50);
        n -= cnt * 50;
        System.out.printf("%d nota(s) de R$ %.2f\n",cnt, 50.0);
        cnt = (int)(n / 20);
        n -= cnt * 20;
        System.out.printf("%d nota(s) de R$ %.2f\n",cnt, 20.0);
        cnt = (int)(n / 10);
        n -= cnt * 10;
        System.out.printf("%d nota(s) de R$ %.2f\n",cnt, 10.0);
        cnt = (int)(n / 5);
        n -= cnt * 5;
        System.out.printf("%d nota(s) de R$ %.2f\n",cnt, 5.0);
        cnt = (int)(n / 2);
        n -= cnt * 2;
        System.out.printf("%d nota(s) de R$ %.2f\n",cnt, 2.0);

        System.out.println("MOEDAS:");
        cnt = (int)(n / 1);
        n -= cnt * 1;
        System.out.printf("%d moeda(s) de R$ %.2f\n",cnt, 1.0);
        cnt = (int)(n / 0.5);
        n -= cnt * 0.5;
        System.out.printf("%d moeda(s) de R$ %.2f\n",cnt, 0.5);
        cnt = (int)(n / 0.25);
        n -= cnt * 0.25;
        System.out.printf("%d moeda(s) de R$ %.2f\n",cnt, 0.25);
        cnt = (int)(n / 0.1);
        n -= cnt * 0.1;
        System.out.printf("%d moeda(s) de R$ %.2f\n",cnt, 0.1);
        cnt = (int)(n / 0.05);
        n -= cnt * 0.05;
        System.out.printf("%d moeda(s) de R$ %.2f\n",cnt, 0.05);
        cnt = (int)(n / 0.01);
        n -= cnt * 0.01;
        System.out.printf("%d moeda(s) de R$ %.2f\n",cnt, 0.01);
    }
}


活动打卡代码 AcWing 655. 天数转换

Lina_6
13小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int years = n /365;
        n %= 365;
        int months = n / 30;
        int days = n % 30;
        System.out.printf("%d ano(s)\n",years);
        System.out.printf("%d mes(es)\n",months);
        System.out.printf("%d dia(s)\n",days);
    }
}


活动打卡代码 AcWing 618. 燃料消耗

Lina_6
13小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt(),s = sc.nextInt();
        System.out.printf("%.3f",(double)s * t / 12.0);
    }
}


活动打卡代码 AcWing 617. 距离

Lina_6
14小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int L = sc.nextInt();
        int minutos = 2 * L;
        System.out.printf("%d minutos",minutos);
    }
}


活动打卡代码 AcWing 614. 最大值

Lina_6
14小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
        int x = (a + b + Math.abs(a - b)) / 2;
        int y = (x + c + Math.abs(x - c)) / 2;
        System.out.printf("%d eh o maior", y);
    }
}


活动打卡代码 AcWing 610. 工资和奖金

Lina_6
14小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String name = sc.next();
        double salary = sc.nextDouble(), sales = sc.nextDouble();
        System.out.printf("TOTAL = R$ %.2f",salary + sales * 0.15);
    }
}


活动打卡代码 AcWing 607. 平均数2

Lina_6
14小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble(), b = sc.nextDouble(), c = sc.nextDouble();
        System.out.printf("MEDIA = %.1f",(2 * a + 3 * b + 5 * c) / (2 + 3 + 5));
    }
}


活动打卡代码 AcWing 613. 面积

Lina_6
14小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double A = sc.nextDouble(), B = sc.nextDouble(), C = sc.nextDouble();
        System.out.printf("TRIANGULO: %.3f\n", A * C / 2);
        System.out.printf("CIRCULO: %.3f\n",3.14159 * C * C);
        System.out.printf("TRAPEZIO: %.3f\n",(A + B) * C / 2);
        System.out.printf("QUADRADO: %.3f\n",B * B);
        System.out.printf("RETANGULO: %.3f\n",A * B);
    }
}


活动打卡代码 AcWing 612. 球的体积

Lina_6
16小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double R = sc.nextDouble();
        System.out.printf("VOLUME = %.3f",(4/3.0) * 3.14159 * R * R * R);
    }
}


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

Lina_6
16小时前
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double number1 = sc.nextDouble(),count1 = sc.nextDouble(), price1 = sc.nextDouble();
        double number2 = sc.nextDouble(),count2 = sc.nextDouble(), price2 = sc.nextDouble();
        System.out.printf("VALOR A PAGAR: R$ %.2f",count1 * price1 + count2 * price2);
    }
}