You are viewing a single comment's thread. Return to all comments →
Here is full code: but please first understand it before use...
import java.util.; import java.io.;
class Solution{ public static void main(String []argh){ Scanner in = new Scanner(System.in); int t=in.nextInt(); int temp = 0; for(int i=0;i for(int j = 1; j <= n; j++){ temp += (int)(Math.pow(2, j-1) * b); System.out.print((a + temp) + " "); } temp = 0; System.out.printf("\n"); } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Loops II
You are viewing a single comment's thread. Return to all comments →
Here is full code: but please first understand it before use...
import java.util.; import java.io.;
class Solution{ public static void main(String []argh){ Scanner in = new Scanner(System.in); int t=in.nextInt(); int temp = 0; for(int i=0;i for(int j = 1; j <= n; j++){ temp += (int)(Math.pow(2, j-1) * b); System.out.print((a + temp) + " "); } temp = 0; System.out.printf("\n"); } } }