File tree 20 files changed +704
-0
lines changed
20 files changed +704
-0
lines changed Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
1
+ /bin /
Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P42
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ System .out .println ("Enter n: " );
20
+ int n =input .nextInt (); // عددی که از کاربر گرفته میشود
21
+
22
+ int sum =0 ; //برای حاصل جمع ارقام
23
+ while (n >0 )
24
+ {
25
+ int r =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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P43
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ System .out .println ("Enter n: " );
20
+ int n =input .nextInt (); // عددی که از کاربر گرفته میشود
21
+
22
+ int sum =0 ; //برای حاصل جمع ارقام
23
+ while (n >0 )
24
+ {
25
+ int r =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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P44
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ System .out .println ("Enter n: " );
20
+ int n =input .nextInt (); // عددی که از کاربر گرفته میشود
21
+
22
+ int sum =0 ; //برای حاصل جمع ارقام
23
+ while (n >0 )
24
+ {
25
+ int r =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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P45
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ System .out .println ("Enter n: " );
20
+ int n =input .nextInt (); // عددی که از کاربر گرفته میشود
21
+
22
+ int count =0 ; //ارقام تعداد
23
+ while (n >0 )
24
+ {
25
+ int r =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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P46
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ System .out .println ("Enter n: " );
20
+ int n =input .nextInt (); // عددی که از کاربر گرفته میشود
21
+
22
+ int count =0 ; //ارقام تعداد
23
+ while (n >0 )
24
+ {
25
+ int r =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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P47
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ System .out .println ("Enter n: " );
20
+ int n =input .nextInt (); // عددی که از کاربر گرفته میشود
21
+
22
+ int count =0 ; //ارقام تعداد
23
+ while (n >0 )
24
+ {
25
+ int r =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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P48
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ System .out .println ("Enter n: " );
20
+ int n =input .nextInt (); // عددی که از کاربر گرفته میشود
21
+
22
+ int p =1 ; // برای حاصل ضرب ارقام
23
+ while (n >0 )
24
+ {
25
+ int r =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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P49
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ System .out .println ("Enter n: " );
20
+ int n =input .nextInt (); // عددی که از کاربر گرفته میشود
21
+
22
+ int p =1 ; // برای حاصل ضرب ارقام
23
+ while (n >0 )
24
+ {
25
+ int r =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
You can’t perform that action at this time.
0 commit comments