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

Commit85f2440

Browse files
Irani-LaptopIrani-Laptop
Irani-Laptop
authored and
Irani-Laptop
committed
first time
1 parent0d3292c commit85f2440

File tree

8 files changed

+205
-0
lines changed

8 files changed

+205
-0
lines changed

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

‎P87P89/.gitignore

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

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

‎P87P89/src/P871.java

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* P87 : تبدیل یک عدد از مبنای 2 به مبنای 8 روش مستقیم
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/02/05
7+
* @Team gClassAcademy
8+
* @Website youtube.com/gClassAcademy
9+
*
10+
*/
11+
12+
importjava.util.Scanner;
13+
14+
publicclassP871
15+
{
16+
publicstaticvoidmain(String[]args)
17+
{
18+
Scannerinput=newScanner (System.in);
19+
20+
System.out.print("Enter n: ");
21+
longn =input.nextLong();// برای عدد گرفته شده از کاربر
22+
System.out.println(n);
23+
24+
25+
longp=1;
26+
longsum =0;
27+
while (n>0)
28+
{
29+
longr =n%1000;
30+
longk =r%10 + (((r/10)%10) *2) + ((r/100) *4);
31+
32+
sum =sum +p *k;
33+
p=p*10;
34+
35+
n =n/1000;
36+
}
37+
38+
System.out.println(sum);
39+
40+
41+
42+
43+
}// end of main
44+
}// end of class
45+
46+
47+
48+
49+
50+
51+
52+
53+

‎P87P89/src/P88.java

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* P88 : تبدیل یک عدد از مبنای 10 به مبنای 16 روش رشته ای
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/02/05
7+
* @Team gClassAcademy
8+
* @Website youtube.com/gClassAcademy
9+
*
10+
*/
11+
12+
importjava.util.Scanner;
13+
14+
publicclassP88
15+
{
16+
publicstaticvoidmain(String[]args)
17+
{
18+
Scannerinput=newScanner (System.in);
19+
20+
System.out.print("Enter n: ");
21+
longn =input.nextLong();// برای عدد گرفته شده از کاربر
22+
23+
Strings="";// برای حاصل جمع نهایی
24+
while (n>0)
25+
{
26+
longr =n %16;
27+
28+
if (r<10)
29+
s =r +s;
30+
else
31+
s = (char)(r+55) +s;
32+
33+
n =n/16;
34+
}
35+
36+
System.out.println(s);
37+
38+
39+
40+
41+
42+
}// end of main
43+
}// end of class
44+
45+
46+
47+
48+
49+
50+
51+
52+

‎P87P89/src/P89.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* P89 : تبدیل یک عدد از مبنای 2 به مبنای 16 روش مستقیم
3+
*
4+
* @author Gholamali Nejad Hajali Irani
5+
* @version 1.0
6+
* @since 2021/02/05
7+
* @Team gClassAcademy
8+
* @Website youtube.com/gClassAcademy
9+
*
10+
*/
11+
12+
importjava.util.Scanner;
13+
14+
publicclassP89
15+
{
16+
publicstaticvoidmain(String[]args)
17+
{
18+
Scannerinput=newScanner (System.in);
19+
20+
System.out.print("Enter n: ");
21+
longn =input.nextLong();// برای عدد گرفته شده از کاربر
22+
//System.out.println(n);
23+
24+
25+
Stringsum ="";
26+
while (n>0)
27+
{
28+
longr =n%10000;
29+
longk =r%10 + (((r/10)%10) *2) + ((r/100)%10 *4) + (r/1000)*8;
30+
31+
if (k<10)
32+
sum =k +sum;
33+
else
34+
sum = (char)(k+55) +sum;
35+
36+
n =n/10000;
37+
}
38+
39+
System.out.println(sum);
40+
41+
42+
43+
44+
}// end of main
45+
}// end of class
46+
47+
48+
49+
50+
51+
52+
53+
54+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp