Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class EqualSumsEvenPositions {
- public static void main(String[] agrs) {
- Scanner scanner = new Scanner(System.in);
- int num1 = Integer.parseInt(scanner.nextLine());
- int num2 = Integer.parseInt(scanner.nextLine());
- for (int i = num1; i <= num2 ; i++) {
- int first = i / 100000;
- int second = (i / 10000) % 10;
- int third = (i / 1000) % 10;
- int forth = (i / 100) % 10;
- int fifth = (i / 10) % 10;
- int sixth = i % 10;
- if(first + third + fifth == second + forth + sixth){
- System.out.print(i + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement