-
Notifications
You must be signed in to change notification settings - Fork 0
/
Task_10.java
60 lines (40 loc) · 1.04 KB
/
Task_10.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Task_10
import java.util.Scanner;
public class Task_10 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter number : ");
int now = scan.nextInt();
System.out.println();
int pk = 1;
int pkk = 1;
int agk = 10;
int agkk = 10;
int ak = 0;
int akk = 0;
int jk = 1;
int kkk =0;
while(pk != 0){
ak = now / agk;
if (ak != 0) {
agk *= 10;
}else{break;}
jk ++;
pk ++;
}
while (pkk != 0) {
if (agk == 0) {
break;
}
else{
agk /= 10;
if (agk != 0) {
kkk = now / agk;
System.out.print(kkk + ",");
now %= agk;
}
}
}
scan.close();
}
}