Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package ex5_;
- import java.util.Scanner;
- /**
- *
- * @author bil
- */
- public class Ex5_ {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- Scanner sc = new Scanner(System.in);
- int a=sc.nextInt() , b=sc.nextInt(), j,num;
- j=a;
- while(j>Integer.MIN_VALUE){
- j--;
- for(num=0;num<a+1;num++){
- if((j+num)==a){
- if((j-num)==b){
- System.out.printf("j(%d) + num(%d) = %d \n",j,num,j+num);
- System.out.printf("j(%d) - num(%d) = %d \n",j,num,j-num);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement