- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaLoopsII.java
More file actions
Latest commit
27 lines (22 loc) · 690 Bytes
/
Copy pathJavaLoopsII.java
File metadata and controls
27 lines (22 loc) · 690 Bytes
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
importjava.util.*;
importjava.io.*;
classSolution {
publicstaticvoidmain(String []argh) {
Scannerin = newScanner(System.in);
intt=in.nextInt();
for(inti=0;i<t;i++) {
inta = in.nextInt();
intb = in.nextInt();
intn = in.nextInt();
// Java Loops II - Hacker Rank Solution Java START
for (intj = 0; j < n; j++)
{
a += b * (int) Math.pow(2, j);
System.out.print(a + " ");
}
System.out.println();
// Java Loops II - Hacker Rank Solution Java END
}
in.close();
}
}