File tree 15 files changed +355
-0
lines changed
15 files changed +355
-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 >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 >
Original file line number Diff line number Diff line change
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
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
+ * 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
+ import java .util .Scanner ;
12
+
13
+ public class P64
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ int n =0 ;// عددی که هر مرحله از کاربر دریافت میشود
20
+
21
+
22
+ int sumall =0 ;
23
+ for (int x =1 ;x <=100 ;x ++)
24
+ {
25
+ // گرفتن n
26
+ System .out .println ("Enter n: " );
27
+ n =input .nextInt ();
28
+
29
+ // محاسبات روی n
30
+ // حاصل جمع ارقام n
31
+ int sum =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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P65
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ int n =0 ;// عددی که هر مرحله از کاربر دریافت میشود
20
+
21
+
22
+ int countall =0 ;
23
+ for (int x =1 ;x <=100 ;x ++)
24
+ {
25
+ // گرفتن n
26
+ System .out .println ("Enter n: " );
27
+ n =input .nextInt ();
28
+
29
+ // محاسبات روی n
30
+ // تعداد ارقام n
31
+ int count =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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P66
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ int n =0 ;// عددی که هر مرحله از کاربر دریافت میشود
20
+
21
+
22
+ double sumAvg = 0.0 ; // جمع میانگینهای n های دریافتی از کاربر
23
+ for (int x =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
+ int count =0 ; // برای محاسبه تعداد ارقام n
32
+ int sum =0 ; // برای محاسبه مجموع ارقام n
33
+ while (n >0 )
34
+ {
35
+ sum = sum + n %10 ; //جمع رقم یکان n روی sum
36
+ count ++;
37
+ n =n /10 ; //حذف رقم یکان n
38
+ }
39
+
40
+ double avg = 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
Original file line number Diff line number Diff line change
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
+ import java .util .Scanner ;
12
+
13
+ public class P67
14
+ {
15
+ public static void main (String [] args )
16
+ {
17
+ Scanner input =new Scanner (System .in );
18
+
19
+ int n =0 ;// عددی که هر مرحله از کاربر دریافت میشود
20
+
21
+
22
+ double sumAvg = 0.0 ; // جمع میانگینهای n های دریافتی از کاربر
23
+ int count =0 ; // تعداد اعدادی را که با مقلوبشان برابرند
24
+
25
+ for (int x =1 ;x <=100 ;x ++)
26
+ {
27
+ // گرفتن n
28
+ System .out .println ("Enter n (n>0): " );
29
+ n =input .nextInt ();
30
+ int n1 =n ;
31
+
32
+ // محاسبات روی n
33
+ // محاسبه مقلوب عدد n
34
+ int p =0 ; // مقلوب n
35
+ while (n >0 )
36
+ {
37
+ int r =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
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 >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 >
Original file line number Diff line number Diff line change
1
+ eclipse.preferences.version =1
2
+ encoding//src/P68.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
+ * 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
+ import java .util .Scanner ;
13
+
14
+ public class P68
15
+ {
16
+ public static void main (String [] args )
17
+ {
18
+ Scanner input =new Scanner (System .in );
19
+
20
+ System .out .println ("Enter n: " );
21
+ int n =input .nextInt (); // عدد ورودی
22
+
23
+ int S =0 ;
24
+ int P =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
+
You can’t perform that action at this time.
0 commit comments