Advertisement
Guest User

Ziya Rustamov/ Homework1

a guest
Jun 3rd, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. public class Homework1 {
  2.     public static void main(String[] args){
  3.         int x=2;
  4.         int y=3;
  5.         int z=23;
  6.         int a= Math.abs(a=400);
  7.         int b=Math.abs(b=-200);
  8.         int c= Math.abs(c=-40);
  9.         int d=Math.abs(d=1200);
  10.         int m= 1234;
  11.        
  12.        
  13. System.out.println(f(x,y));
  14. System.out.println(g(z)+ " " + k(z));
  15. System.out.println(Math.abs(l(a,b,c,d)));
  16.  
  17. }
  18.     public static long f(int x, int y){
  19.         return x+y;
  20.     }
  21.     public static long g(int z){
  22.         return z/10;
  23.     }
  24.     public static long k(int z){
  25.         return z%10;
  26.     }
  27.  
  28.     public static long l( int a, int b, int c, int d){
  29.         return Math.abs(a+ b + c - d);
  30.     }
  31.    
  32.     public static long v (int m){
  33.     return m/1000;
  34.     }
  35.    
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement