Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //INGAT YA BRO... MBAK... JANGAN COPY PASTE... UBAH SIKIT KEK
- //Soal No.1
- import java.io.*;
- import java.util.Scanner;
- public class Solution {
- public static void main(String args[])
- {
- long a1,a2,n;
- Scanner in = new Scanner(System.in);
- a1 = in.nextInt();
- a2 = in.nextInt();
- n = in.nextInt();
- if(a1==a2)
- {}
- else
- {
- a2=a2-a1;
- n= a1+((n-1)*a2);
- System.out.println(n);
- }
- }
- }
- //Soal No.2
- import java.util.Scanner;
- import java.lang.Math;
- public class Solution
- {
- public static void main(String args[])
- {
- double radius;
- double volume;
- double diameter;
- Scanner masuk = new Scanner(System.in);
- diameter = masuk.nextDouble();
- radius = diameter / 2d;
- volume = (4d / 3)*Math.PI * Math.pow(radius, 3);
- System.out.println(volume);
- }
- }
- //Soal No.3
- BONUS CUK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement