- import jaa.util.Scanner;
- public class LoopAlgorithm {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int t = in.nextInt();
- for (int i = 0; i < t; i++) {
- int a = in.nextInt();
- int b = in.nextInt();
- int n = in.nextInt();
- int result = 0;
- for (int j = 0; j < n; j++) {
- if (j == 0) {
- result = (result +a + (int) (Math.pow(2, j) * b));
- } else {
- result = (int) Math.pow(2, j) * b;
- System.out.println(result+" ");
- }
- }
- System.out.print("");
- }
- in.close();
- }
- }
Tuesday, April 23, 2019
Java Loop
Subscribe to:
Post Comments (Atom)
How to run standalone mock server on local laptop
Please download the standalone wiremock server from Direct download section at the bottom of the page. Download and installation Feel fre...
-
Cryptography or cryptology (from Ancient Greek: kryptós "hidden, secret"; graphein, "to write") is the practice and stu...
-
Problem statement: In a dark room,there is a box of 18 white and 5 black gloves. You are allowed to pick one and then you are allowed to k...
-
Please download the standalone wiremock server from Direct download section at the bottom of the page. Download and installation Feel fre...
No comments:
Post a Comment