头像

小学库




离线:2天前


最近来访(0)

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

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


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

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


活动打卡代码 AcWing 617. 距离

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int L = sc.nextInt();
        double hour = L / 30.0;
        System.out.printf("%d minutos",(int)(hour * 60));
    }
}


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

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 614. 最大值

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();
        System.out.printf("%d eh o maior",Math.max(a,Math.max(b,c)));
    }

}


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

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


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

import java.util.Scanner;

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


活动打卡代码 AcWing 613. 面积

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",A * B); } }



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

import java.util.Scanner;

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


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

import java.util.Scanner;

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