Advertisement
Ronaldoztupang

Jawaban saya ini, jangan copas

Sep 10th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. //INGAT YA BRO... MBAK... JANGAN COPY PASTE... UBAH SIKIT KEK
  2. //Soal No.1
  3. import java.io.*;
  4. import java.util.Scanner;
  5.  
  6. public class Solution {
  7.  
  8.     public static void main(String args[])
  9.  {
  10.         long a1,a2,n;
  11.         Scanner in = new Scanner(System.in);
  12.         a1 = in.nextInt();
  13.         a2 = in.nextInt();
  14.         n = in.nextInt();
  15.         if(a1==a2)
  16.             {}
  17.         else
  18.             {
  19.             a2=a2-a1;
  20.             n= a1+((n-1)*a2);
  21.             System.out.println(n);
  22.             }
  23.      }    
  24. }
  25. //Soal No.2
  26. import java.util.Scanner;
  27. import java.lang.Math;
  28. public class Solution
  29. {
  30.     public static void main(String args[])
  31.     {
  32.         double radius;
  33.         double volume;
  34.         double diameter;
  35.  
  36.         Scanner masuk = new Scanner(System.in);
  37.         diameter = masuk.nextDouble();
  38.         radius = diameter / 2d;
  39.  
  40.         volume = (4d / 3)*Math.PI * Math.pow(radius, 3);
  41.         System.out.println(volume);
  42.     }    
  43. }
  44. //Soal No.3
  45. BONUS CUK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement