Advertisement
Guest User

Lab 1 krosplatform

a guest
Sep 1st, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. package javaapplication1;
  7.  
  8. /**
  9.  *
  10.  * @author mf12210
  11.  */
  12.  
  13.  
  14.  
  15. public class Main {
  16.  
  17.     /**
  18.      * @param args the command line arguments
  19.      */
  20.     static final double p = 3.1416;
  21.     public static void main(String[] args) {
  22.         // TODO code application logic here
  23.  
  24.         System.out.println("Hello, world");
  25.         int a, b = 10;
  26.         double s;
  27.         a = 7;
  28.         s = a * b ;
  29.         System.out.println ("Площадь прямоугольника со сторонами 10 см и 7 см равна " + s + " квадратным сантиметрам.");
  30.         a = 3;
  31.         b = 4;
  32.         s = 0.5 * a * b;
  33.         System.out.println ("Площадь прямоугольного треугольника со сторонами 3 см и 4 см равна " + s + " квадратным сантиметрам.");
  34.     }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement