Advertisement
saykotislam

201-15-13993_11

Feb 21st, 2021
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. package lab;
  2. import java.util.Scanner;
  3.  
  4. class AddDistance{
  5.     int a,b,c,d,sum,e,in,fe;
  6.    
  7.     void sum( )
  8.     {
  9.        Scanner input=new Scanner(System.in);
  10.         a=input.nextInt();
  11.         b=input.nextInt();
  12.         c=input.nextInt();
  13.         d=input.nextInt();
  14.        in=a+c;
  15.        fe=b+d;
  16.        
  17.        if(fe>11){
  18.            in++;
  19.            e=fe-11;
  20.        }
  21.        else e=fe;
  22.        
  23.        System.out.println("Ans: "+in+"fe "+e+"In ");
  24.        
  25.     }
  26.  
  27. }
  28.    
  29.  
  30. public class objdis {
  31.  
  32.    
  33.     public static void main(String[] args) {
  34.        
  35.        
  36.         AddDistance inf=new AddDistance();
  37.        
  38.         inf.sum();
  39.        
  40.          
  41.          
  42.          
  43.            
  44.                                  
  45.     }
  46.    
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement