Skip to content

Commit 7ef1a6f

Browse files
author
Hud
committed
GITA MASALA
1 parent 237ae3b commit 7ef1a6f

File tree

13 files changed

+181
-21
lines changed

13 files changed

+181
-21
lines changed
1 Byte
Binary file not shown.
2 Bytes
Binary file not shown.
1.15 KB
Binary file not shown.
27 Bytes
Binary file not shown.
107 Bytes
Binary file not shown.

src/fori/forexample.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package fori;
2+
3+
public class forexample {
4+
public static void main(String[] args) {
5+
// [x^0 + x^1 + x^2 + x^3 + ... x^n]
6+
int sum = 0;
7+
int n=7, x = 2;
8+
// [2^0 + 2^1 + 2^2 + 2^3 + 2^4 + 2^5 + 2^7 + 2^7]
9+
10+
for (int i = 0 ; i<= n; i++) {
11+
int powerSum = 1;
12+
13+
for (int j = 0; j < i; j++) {
14+
powerSum *= x;
15+
}
16+
//System.out.print(powerSum +" ");
17+
sum += powerSum;
18+
}
19+
20+
System.out.println(sum);
21+
22+
23+
24+
25+
26+
}
27+
}

src/swichcase/case16.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public static void main(String[] args) {
77
Scanner scanner=new Scanner(System.in);
88
System.out.println("number :");
99
int number=scanner.nextInt();
10-
if (number<100 && 0<number){
10+
if (number<69 && 21<number){
1111
decimal(number);
1212
unit(number,"yosh");
1313
}

src/swichcase/case17.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ public static void main(String[] args) {
99
int number=scanner.nextInt();
1010
if (number<100 && 0<number){
1111
decimal(number);
12-
unit(number,"masala");
12+
unit(number);
1313
}
1414
else {
1515
System.err.println("Sonlar oralig`i 1...99");
1616
}
1717
}
18-
public static void unit(int number,String str){
18+
public static void unit(int number){
19+
String str="masala";
1920
int result =number%10;
2021
if (number<10){
2122
switch (number){

src/swichcase/example.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package swichcase;
2+
3+
public class example {
4+
public static void main(String[] args) {
5+
char a='g';
6+
System.out.println(a);
7+
}
8+
}

src/swichcase/switch10.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ public static void solution(char y, int k) {
4242
switch (y) {
4343
case 's' -> result = garb;
4444
case 'j' -> result = sharq;
45-
case 'q' -> result = north;
46-
case 'g' -> result = south;
45+
case 'q' -> result = north;//Shimol
46+
case 'g' -> result = south;//Janub
4747
}
4848
}
4949
case 2 -> { // o'ngga
5050
switch (y) {
5151
case 's' -> result = sharq;
5252
case 'j' -> result = garb;
53-
case 'q' -> result = south;
54-
case 'g' -> result = north;
53+
case 'q' -> result = south;//Janub
54+
case 'g' -> result = north;//Shimol
5555
}
5656
}
5757
}

0 commit comments

Comments
 (0)