- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJavaLoopsII.java
More file actions
Latest commit
22 lines (19 loc) · 596 Bytes
/
Copy pathJavaLoopsII.java
File metadata and controls
22 lines (19 loc) · 596 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
packageIntroduction;
importjava.util.*;
importjava.lang.Math;
publicclassJavaLoopsII {
publicstaticvoidmain(String[] args) {
Scannerscan = newScanner(System.in);
intcount = scan.nextInt();
for (intx = 0; x < count; x++) {
intstart = scan.nextInt();
intstep = scan.nextInt();
intlimit = scan.nextInt();
for (inty = 0; y < limit; y++) {
start += Math.pow(2, y) * step;
System.out.printf("%d ", start);
}
System.out.printf("%n");
}
}
}