-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP75.java
More file actions
62 lines (40 loc) · 949 Bytes
/
P75.java
File metadata and controls
62 lines (40 loc) · 949 Bytes
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
/**
* P75 : جدول ضرب مبنای 8
*
* @author Gholamali Nejad Hajali Irani
* @version 1.0
* @since 2021/02/04
* @Team gClassAcademy
* @Website youtube.com/gClassAcademy
*
*/
import java.util.Scanner;
public class P75
{
public static void main(String[] args)
{
Scanner input=new Scanner (System.in);
System.out.print("Enter n: ");
for (int x=1;x<=7;x++)
{
System.out.println();
for (int y=1;y<=7;y++)
{
//System.out.print(x*y + " ");
long n=x*y;
long s=0; // برای حاصل جمع نهایی
long p=1; //برای تولید توانهای 10
while (n>0)
{
s = s + p * (n%8);
p = p*10;
n = n/8;
}
if (s>=10 && s<=99)
System.out.print(s + " ");
else
System.out.print(s + " ");
}
}
}// end of main
}// end of class