Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b67cb6

Browse files
Irani-LaptopIrani-Laptop
Irani-Laptop
authored and
Irani-Laptop
committed
first time
1 parent985db6c commit0b67cb6

20 files changed

+704
-0
lines changed

‎P42P56/.classpath

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

‎P42P56/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

‎P42P56/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>P42P56</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>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
eclipse.preferences.version=1
2+
encoding//src/P42.java=UTF-8
3+
encoding//src/P43.java=UTF-8
4+
encoding//src/P44.java=UTF-8
5+
encoding//src/P45.java=UTF-8
6+
encoding//src/P46.java=UTF-8
7+
encoding//src/P47.java=UTF-8
8+
encoding//src/P48.java=UTF-8
9+
encoding//src/P49.java=UTF-8
10+
encoding//src/P50.java=UTF-8
11+
encoding//src/P51.java=UTF-8
12+
encoding//src/P52.java=UTF-8
13+
encoding//src/P53.java=UTF-8
14+
encoding//src/P54.java=UTF-8
15+
encoding//src/P55.java=UTF-8
16+
encoding//src/P56.java=UTF-8
Lines changed: 14 additions & 0 deletions
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

‎P42P56/src/P42.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* P42 : مجموع ارقام یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/03
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*/
10+
11+
importjava.util.Scanner;
12+
13+
publicclassP42
14+
{
15+
publicstaticvoidmain(String[]args)
16+
{
17+
Scannerinput=newScanner (System.in);
18+
19+
System.out.println("Enter n: ");
20+
intn=input.nextInt();// عددی که از کاربر گرفته میشود
21+
22+
intsum=0;//برای حاصل جمع ارقام
23+
while (n>0)
24+
{
25+
intr=n%10;//برای رقم یکان
26+
27+
// محاسبات روی رقم یکان عدد
28+
sum=sum+r;
29+
30+
// حذف رقم یکان
31+
n=n/10;
32+
}// end of while
33+
34+
// چاپ نتیجه
35+
System.out.println("Sum is: " +sum);
36+
37+
38+
39+
}// end of main
40+
}// end of class

‎P42P56/src/P43.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* P43 : مجموع ارقام زوج یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/03
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*/
10+
11+
importjava.util.Scanner;
12+
13+
publicclassP43
14+
{
15+
publicstaticvoidmain(String[]args)
16+
{
17+
Scannerinput=newScanner (System.in);
18+
19+
System.out.println("Enter n: ");
20+
intn=input.nextInt();// عددی که از کاربر گرفته میشود
21+
22+
intsum=0;//برای حاصل جمع ارقام
23+
while (n>0)
24+
{
25+
intr=n%10;//برای رقم یکان
26+
27+
// محاسبات روی رقم یکان عدد
28+
if (r%2==0)
29+
sum=sum+r;
30+
31+
// حذف رقم یکان
32+
n=n/10;
33+
}// end of while
34+
35+
// چاپ نتیجه
36+
System.out.println("Sum is: " +sum);
37+
38+
39+
40+
}// end of main
41+
}// end of class

‎P42P56/src/P44.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* P44 : مجموع ارقام فرد یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/03
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*/
10+
11+
importjava.util.Scanner;
12+
13+
publicclassP44
14+
{
15+
publicstaticvoidmain(String[]args)
16+
{
17+
Scannerinput=newScanner (System.in);
18+
19+
System.out.println("Enter n: ");
20+
intn=input.nextInt();// عددی که از کاربر گرفته میشود
21+
22+
intsum=0;//برای حاصل جمع ارقام
23+
while (n>0)
24+
{
25+
intr=n%10;//برای رقم یکان
26+
27+
// محاسبات روی رقم یکان عدد
28+
if (r%2==1)
29+
sum=sum+r;
30+
31+
// حذف رقم یکان
32+
n=n/10;
33+
}// end of while
34+
35+
// چاپ نتیجه
36+
System.out.println("Sum is: " +sum);
37+
38+
39+
40+
}// end of main
41+
}// end of class

‎P42P56/src/P45.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* P45 : تعداد ارقام یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/03
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*/
10+
11+
importjava.util.Scanner;
12+
13+
publicclassP45
14+
{
15+
publicstaticvoidmain(String[]args)
16+
{
17+
Scannerinput=newScanner (System.in);
18+
19+
System.out.println("Enter n: ");
20+
intn=input.nextInt();// عددی که از کاربر گرفته میشود
21+
22+
intcount=0;//ارقام تعداد
23+
while (n>0)
24+
{
25+
intr=n%10;//برای رقم یکان
26+
27+
// محاسبات روی رقم یکان عدد
28+
count++;
29+
30+
// حذف رقم یکان
31+
n=n/10;
32+
}// end of while
33+
34+
// چاپ نتیجه
35+
System.out.println("Count is: " +count);
36+
37+
38+
39+
}// end of main
40+
}// end of class

‎P42P56/src/P46.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* P46 : تعداد ارقام زوج یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/03
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*/
10+
11+
importjava.util.Scanner;
12+
13+
publicclassP46
14+
{
15+
publicstaticvoidmain(String[]args)
16+
{
17+
Scannerinput=newScanner (System.in);
18+
19+
System.out.println("Enter n: ");
20+
intn=input.nextInt();// عددی که از کاربر گرفته میشود
21+
22+
intcount=0;//ارقام تعداد
23+
while (n>0)
24+
{
25+
intr=n%10;//برای رقم یکان
26+
27+
// محاسبات روی رقم یکان عدد
28+
if (r%2==0)
29+
count++;
30+
31+
// حذف رقم یکان
32+
n=n/10;
33+
}// end of while
34+
35+
// چاپ نتیجه
36+
System.out.println("Count is: " +count);
37+
38+
39+
40+
}// end of main
41+
}// end of class

‎P42P56/src/P47.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* P47 : تعداد ارقام فرد یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/03
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*/
10+
11+
importjava.util.Scanner;
12+
13+
publicclassP47
14+
{
15+
publicstaticvoidmain(String[]args)
16+
{
17+
Scannerinput=newScanner (System.in);
18+
19+
System.out.println("Enter n: ");
20+
intn=input.nextInt();// عددی که از کاربر گرفته میشود
21+
22+
intcount=0;//ارقام تعداد
23+
while (n>0)
24+
{
25+
intr=n%10;//برای رقم یکان
26+
27+
// محاسبات روی رقم یکان عدد
28+
if (r%2==1)
29+
count++;
30+
31+
// حذف رقم یکان
32+
n=n/10;
33+
}// end of while
34+
35+
// چاپ نتیجه
36+
System.out.println("Count is: " +count);
37+
38+
39+
40+
}// end of main
41+
}// end of class

‎P42P56/src/P48.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* P48 : حاصل ضرب ارقام یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/03
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*/
10+
11+
importjava.util.Scanner;
12+
13+
publicclassP48
14+
{
15+
publicstaticvoidmain(String[]args)
16+
{
17+
Scannerinput=newScanner (System.in);
18+
19+
System.out.println("Enter n: ");
20+
intn=input.nextInt();// عددی که از کاربر گرفته میشود
21+
22+
intp=1;// برای حاصل ضرب ارقام
23+
while (n>0)
24+
{
25+
intr=n%10;//برای رقم یکان
26+
27+
// محاسبات روی رقم یکان عدد
28+
p=p*r;
29+
30+
// حذف رقم یکان
31+
n=n/10;
32+
}// end of while
33+
34+
// چاپ نتیجه
35+
System.out.println("Product is: " +p);
36+
37+
38+
39+
}// end of main
40+
}// end of class

‎P42P56/src/P49.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* P49 : حاصل ضرب ارقام روج یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/03
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*/
10+
11+
importjava.util.Scanner;
12+
13+
publicclassP49
14+
{
15+
publicstaticvoidmain(String[]args)
16+
{
17+
Scannerinput=newScanner (System.in);
18+
19+
System.out.println("Enter n: ");
20+
intn=input.nextInt();// عددی که از کاربر گرفته میشود
21+
22+
intp=1;// برای حاصل ضرب ارقام
23+
while (n>0)
24+
{
25+
intr=n%10;//برای رقم یکان
26+
27+
// محاسبات روی رقم یکان عدد
28+
if (r%2==0)
29+
p=p*r;
30+
31+
// حذف رقم یکان
32+
n=n/10;
33+
}// end of while
34+
35+
// چاپ نتیجه
36+
System.out.println("Product is: " +p);
37+
38+
39+
40+
}// end of main
41+
}// end of class

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp