Skip to content

Commit 729ad21

Browse files
Irani-LaptopIrani-Laptop
Irani-Laptop
authored and
Irani-Laptop
committed
first time
1 parent 86fdad5 commit 729ad21

21 files changed

+450
-0
lines changed

P74/.classpath

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
4+
<attributes>
5+
<attribute name="module" value="true"/>
6+
</attributes>
7+
</classpathentry>
8+
<classpathentry kind="src" path="src"/>
9+
<classpathentry kind="output" path="bin"/>
10+
</classpath>

P74/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

P74/.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>P74</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding//src/P74.java=UTF-8
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=11
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
13+
org.eclipse.jdt.core.compiler.release=enabled
14+
org.eclipse.jdt.core.compiler.source=11

P74/src/P74.java

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* P74 : جدول ضرب اعداد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/29
7+
* @Team gClassAcademy
8+
* @Website youtube.com/gClassAcademy
9+
*
10+
*/
11+
12+
import java.util.Scanner;
13+
14+
public class P74
15+
{
16+
public static void main(String[] args)
17+
{
18+
Scanner input=new Scanner (System.in);
19+
20+
21+
System.out.println();
22+
for (int x=1;x<=10;x++)
23+
{
24+
for (int y=1;y<=10;y++)
25+
if (x*y>=1 && x*y<=9)
26+
System.out.print(" " + x*y + " ");
27+
else
28+
System.out.print(x*y + " ");
29+
System.out.println("");
30+
}
31+
32+
33+
34+
35+
36+
37+
}// end of main
38+
}// end of class
39+
40+
41+
42+
43+
44+
45+
46+
47+

P76/.classpath

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
4+
<attributes>
5+
<attribute name="module" value="true"/>
6+
</attributes>
7+
</classpathentry>
8+
<classpathentry kind="src" path="src"/>
9+
<classpathentry kind="output" path="bin"/>
10+
</classpath>

P76/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

P76/.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>P76</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding//src/P76.java=UTF-8
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=11
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
13+
org.eclipse.jdt.core.compiler.release=enabled
14+
org.eclipse.jdt.core.compiler.source=11

P76/src/P76.java

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/**
2+
* P76 : تشخیص وجود یک عدد در سری فیبوناچی و اول بودن آن در بین 100 عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/29
7+
* @Team gClassAcademy
8+
* @Website youtube.com/gClassAcademy
9+
*/
10+
11+
import java.util.Scanner;
12+
13+
public class P76
14+
{
15+
public static void main(String[] args)
16+
{
17+
Scanner input=new Scanner (System.in);
18+
19+
int n=0;// عددی که هر مرحله از کاربر دریافت میشود
20+
int allcount=0; // تعداد اعدادی که هم اول و هم فیبوناچی هستن
21+
22+
for (int x=1;x<=100;x++)
23+
{
24+
// گرفتن n
25+
System.out.println("Enter n" + x + ": ");
26+
n=input.nextInt();
27+
28+
// محاسبات روی n
29+
30+
// بررسی وجود n در سری فیبوناچی
31+
long a=1; //عدد اول در سری فیبوناچی
32+
long b=1; //عدد دوم در سری فیبوناچی
33+
long c=0; //عدد جمع دوتای قبلی در سری فیبوناچی
34+
while (c<n && n!=1)
35+
{
36+
c=a+b;
37+
//System.out.println(count + ": " + c);
38+
a=b;
39+
b=c;
40+
}
41+
42+
43+
// عدد فیبوناچی هست
44+
if (c==n || n==1)
45+
{
46+
//System.out.println("yes");
47+
48+
//بررسی اول بودن n
49+
int count=0;
50+
for (int y=1;y<=n;y++)
51+
if (n%y==0)
52+
count++;
53+
54+
// عدد n اول هست
55+
if (count==2)
56+
allcount++;
57+
}
58+
59+
60+
}// end of for x
61+
62+
63+
System.out.println("All count is: " + allcount);
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
}// end of main
75+
}// end of class

P77P80/.classpath

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
4+
<attributes>
5+
<attribute name="module" value="true"/>
6+
</attributes>
7+
</classpathentry>
8+
<classpathentry kind="src" path="src"/>
9+
<classpathentry kind="output" path="bin"/>
10+
</classpath>

P77P80/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

P77P80/.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>P77P80</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
encoding//src/P77.java=UTF-8
3+
encoding//src/P78.java=UTF-8
4+
encoding//src/P79.java=UTF-8
5+
encoding//src/P80.java=UTF-8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=11
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
13+
org.eclipse.jdt.core.compiler.release=enabled
14+
org.eclipse.jdt.core.compiler.source=11

P77P80/src/P77.java

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* P77 : بررسی کامل بودن یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/29
7+
* @Team gClassAcademy
8+
* @Website youtube.com/gClassAcademy
9+
*
10+
*/
11+
12+
import java.util.Scanner;
13+
14+
public class P77
15+
{
16+
public static void main(String[] args)
17+
{
18+
Scanner input=new Scanner (System.in);
19+
20+
System.out.print("Enter n:");
21+
int n = input.nextInt(); //عدد ورودی
22+
int sum=0; // برای جمع مقسوم علیه های n بجز خودش
23+
24+
for (int x=1;x<=n/2;x++)
25+
if (n%x==0)
26+
{
27+
sum+=x;
28+
System.out.println(x);
29+
}
30+
31+
System.out.println("Sum is: " + sum);
32+
33+
if (sum==n)
34+
System.out.println("Yes");
35+
36+
37+
}// end of main
38+
}// end of class
39+
40+
41+
42+
43+
44+
45+
46+
47+

P77P80/src/P78.java

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* P78 : چاپ اعداد کامل کمتر از 1000
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/29
7+
* @Team gClassAcademy
8+
* @Website youtube.com/gClassAcademy
9+
*
10+
*/
11+
12+
import java.util.Scanner;
13+
14+
public class P78
15+
{
16+
public static void main(String[] args)
17+
{
18+
Scanner input=new Scanner (System.in);
19+
20+
21+
for (int n=1;n<=10000;n++)
22+
{
23+
int sum=0; // برای جمع مقسوم علیه های n بجز خودش
24+
25+
for (int x=1;x<=n/2;x++)
26+
if (n%x==0)
27+
sum+=x;
28+
29+
30+
if (sum==n)
31+
System.out.println(n);
32+
}
33+
34+
}// end of main
35+
}// end of class
36+
37+
38+
39+
40+
41+
42+
43+
44+

0 commit comments

Comments
 (0)