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

Commitcea6fe3

Browse files
Irani-LaptopIrani-Laptop
Irani-Laptop
authored and
Irani-Laptop
committed
first time
1 parentb7f1a93 commitcea6fe3

15 files changed

+355
-0
lines changed

‎P64P67/.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>

‎P64P67/.gitignore

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

‎P64P67/.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>P64P67</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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
encoding//src/P64.java=UTF-8
3+
encoding//src/P65.java=UTF-8
4+
encoding//src/P66.java=UTF-8
5+
encoding//src/P67.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

‎P64P67/src/P64.java

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

‎P64P67/src/P65.java

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

‎P64P67/src/P66.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* P66 : میانگین میانگین ارقام 100 عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/15
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*/
10+
11+
importjava.util.Scanner;
12+
13+
publicclassP66
14+
{
15+
publicstaticvoidmain(String[]args)
16+
{
17+
Scannerinput=newScanner (System.in);
18+
19+
intn=0;// عددی که هر مرحله از کاربر دریافت میشود
20+
21+
22+
doublesumAvg =0.0;// جمع میانگینهای n های دریافتی از کاربر
23+
for (intx=1;x<=100;x++)
24+
{
25+
// گرفتن n
26+
System.out.println("Enter n (n>0): ");
27+
n=input.nextInt();
28+
29+
// محاسبات روی n
30+
// تعداد ارقام n
31+
intcount=0;// برای محاسبه تعداد ارقام n
32+
intsum=0;// برای محاسبه مجموع ارقام n
33+
while (n>0)
34+
{
35+
sum =sum +n%10;//جمع رقم یکان n روی sum
36+
count++;
37+
n=n/10;//حذف رقم یکان n
38+
}
39+
40+
doubleavg=1.0 *sum /count;//میانگین ارقام عدد n
41+
sumAvg +=avg;//sumAvg = sumAvg + avg;
42+
43+
}// end of for x
44+
45+
System.out.println("AllAvg is: " +sumAvg/100);
46+
47+
48+
49+
50+
}// end of main
51+
}// end of class

‎P64P67/src/P67.java

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

‎P68/.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>

‎P68/.gitignore

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

‎P68/.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>P68</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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding//src/P68.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

‎P68/src/P68.java

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* P68 : حذف صفرهای یک عدد
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/01/16
7+
* @Team gClassAcademy
8+
* @Website https://www.youtube.com/c/gClassAcademy
9+
*
10+
*/
11+
12+
importjava.util.Scanner;
13+
14+
publicclassP68
15+
{
16+
publicstaticvoidmain(String[]args)
17+
{
18+
Scannerinput=newScanner (System.in);
19+
20+
System.out.println("Enter n: ");
21+
intn=input.nextInt();// عدد ورودی
22+
23+
intS=0;
24+
intP=1;
25+
while (n>0)
26+
{
27+
//محاسبات من روی ارقام
28+
if (n%10 !=0)
29+
{
30+
S =S +P* (n%10);
31+
P=P*10;
32+
}
33+
34+
n=n/10;// حذف رقم یکان
35+
}
36+
37+
System.out.println(S);
38+
39+
40+
41+
42+
}// end of main
43+
}// end of class
44+
45+
46+
47+
48+
49+
50+
51+
52+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp