-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoreNumberPuzzles.java
More file actions
73 lines (66 loc) · 1.64 KB
/
Copy pathMoreNumberPuzzles.java
File metadata and controls
73 lines (66 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* 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 assignment_10528808;
/**
*
* @author Mawutor
*/
import java.util.Scanner;
public class MoreNumberPuzzles
{
public static void function56()
{
for(int i =0;i<=9;i++)
{
for(int y=0;y<=9;y++)
{
int v=i+y;
if(i<=5 && y<=6 && v>10){
System.out.println("("+i+y+")");
}
}
}
}
public static void reversefunc()
{
for(int i =0;i<=9;i++)
{
for(int y=0;y<=9;y++)
{
int v=i-y;
int t=y-i;
int f=y+i;
if(f==f && t==f){
System.out.println("("+i+y+")");
}
}
}
}
public static void main(String[] arg)
{
int t=0;
while(t==0)
{
Scanner input =new Scanner(System.in);
System.out.println("1)Find two digit numbers <= 56 with sums of digits > 10");
System.out.println("2)Find two digit number minus number reversed which equals sum of digits");
System.out.println("3)Quit");
int n=input.nextInt();
if(n==1)
{
function56();
}
else if(n==2)
{
reversefunc();
}
else if(n==3)
{
break;
}
}
}
}