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

Commit7cb0a57

Browse files
Irani-LaptopIrani-Laptop
Irani-Laptop
authored and
Irani-Laptop
committed
first time
1 parent95af1b3 commit7cb0a57

12 files changed

+275
-0
lines changed

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

‎P25P30/.gitignore

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

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

‎P25P30/src/P25.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
importjava.util.Scanner;
2+
3+
publicclassP25 {
4+
5+
publicstaticvoidmain(String[]args)
6+
{
7+
Scannerinput=newScanner (System.in);
8+
9+
System.out.println("Please enter n:");
10+
intn=input.nextInt();
11+
12+
intp=1;
13+
for (intx=1;x<=n;x++)
14+
p=p*x;
15+
16+
17+
System.out.println(n +"! = " +p);
18+
19+
20+
}// end of Main
21+
}// end of Class

‎P25P30/src/P26.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
importjava.util.Scanner;
2+
3+
publicclassP26 {
4+
5+
publicstaticvoidmain(String[]args)
6+
{
7+
Scannerinput=newScanner (System.in);
8+
intn=0;
9+
10+
11+
intsum=0;
12+
for (intx=1;x<=10;x++)
13+
{
14+
n=input.nextInt();
15+
16+
//Calc
17+
18+
sum =sum +n;
19+
}
20+
21+
System.out.println("Sum is: " +sum);
22+
System.out.println("Avg is: " +sum/10.0);
23+
24+
25+
}// end of Main
26+
}// end of Class

‎P25P30/src/P27.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
importjava.util.Scanner;
2+
3+
publicclassP27 {
4+
5+
publicstaticvoidmain(String[]args)
6+
{
7+
Scannerinput=newScanner (System.in);
8+
intn=0;
9+
10+
System.out.println("enter number (" +1 +") : ");
11+
intmin =input.nextInt();
12+
for (intx=2;x<=100;x++)
13+
{
14+
System.out.println("enter number(" +x +") : ");
15+
n=input.nextInt();
16+
17+
//Calc
18+
if (n<min)
19+
min=n;
20+
}
21+
22+
System.out.println("Min is: " +min);
23+
24+
}// end of Main
25+
}// end of Class

‎P25P30/src/P28.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
importjava.util.Scanner;
2+
3+
publicclassP28 {
4+
5+
publicstaticvoidmain(String[]args)
6+
{
7+
Scannerinput=newScanner (System.in);
8+
intn=0;
9+
10+
System.out.println("enter number (" +1 +") : ");
11+
intmax =input.nextInt();
12+
for (intx=2;x<=100;x++)
13+
{
14+
System.out.println("enter number(" +x +") : ");
15+
n=input.nextInt();
16+
17+
//Calc
18+
if (n>max)
19+
max=n;
20+
}
21+
22+
System.out.println("Max is: " +max);
23+
24+
}// end of Main
25+
}// end of Class

‎P25P30/src/P28a.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
importjava.util.Scanner;
2+
3+
publicclassP28a {
4+
5+
publicstaticvoidmain(String[]args)
6+
{
7+
Scannerinput=newScanner (System.in);
8+
intn=0;
9+
10+
System.out.println("enter number (" +1 +") : ");
11+
intmax =input.nextInt();
12+
intmin =max;
13+
14+
15+
for (intx=2;x<=5;x++)
16+
{
17+
System.out.println("enter number(" +x +") : ");
18+
n=input.nextInt();
19+
20+
//Calc
21+
if (n>max)
22+
max=n;
23+
if (n<min)
24+
min=n;
25+
}
26+
27+
System.out.println("Max is: " +max);
28+
System.out.println("Min is: " +min);
29+
30+
}// end of Main
31+
}// end of Class

‎P25P30/src/P29.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
importjava.util.Scanner;
2+
3+
publicclassP29 {
4+
5+
publicstaticvoidmain(String[]args)
6+
{
7+
Scannerinput=newScanner (System.in);
8+
intn=0;
9+
intmin1=0;//اولین کمترین
10+
intmin2=0;// دومین کمترین
11+
12+
System.out.println("enter number(" +1 +") : ");
13+
intn1=input.nextInt();
14+
System.out.println("enter number(" +2 +") : ");
15+
intn2=input.nextInt();
16+
17+
if (n1<n2)
18+
{
19+
min1 =n1;
20+
min2 =n2;
21+
}
22+
else
23+
{
24+
min1 =n2;
25+
min2 =n1;
26+
}
27+
28+
29+
30+
for (intx=3;x<=6;x++)
31+
{
32+
System.out.println("enter number(" +x +") : ");
33+
n=input.nextInt();
34+
35+
//Calc
36+
37+
if (n>min1 &&n<min2)
38+
min2=n;
39+
if (n<min1)
40+
{
41+
min2=min1;
42+
min1=n;
43+
}
44+
}// end of for
45+
46+
System.out.println("Min 1 is: " +min1);
47+
System.out.println("Min 2 is: " +min2);
48+
49+
50+
}// end of Main
51+
}// end of Class

‎P25P30/src/P30.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
importjava.util.Scanner;
2+
3+
publicclassP30 {
4+
5+
publicstaticvoidmain(String[]args)
6+
{
7+
Scannerinput=newScanner (System.in);
8+
intn=0;
9+
intmax1=0;//اولین کمترین
10+
intmax2=0;// دومین کمترین
11+
12+
System.out.println("enter number(" +1 +") : ");
13+
intn1=input.nextInt();
14+
System.out.println("enter number(" +2 +") : ");
15+
intn2=input.nextInt();
16+
17+
if (n1<n2)
18+
{
19+
max1 =n2;
20+
max2 =n1;
21+
}
22+
else
23+
{
24+
max1 =n1;
25+
max2 =n2;
26+
}
27+
28+
29+
30+
for (intx=3;x<=6;x++)
31+
{
32+
System.out.println("enter number(" +x +") : ");
33+
n=input.nextInt();
34+
35+
//Calc
36+
37+
if (n<max1 &&n>max2)
38+
max2=n;
39+
if (n>max1)
40+
{
41+
max2=max1;
42+
max1=n;
43+
}
44+
}// end of for
45+
46+
System.out.println("Max 1 is: " +max1);
47+
System.out.println("Max 2 is: " +max2);
48+
49+
50+
}// end of Main
51+
}// end of Class

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp