You are viewing a single comment's thread. Return to all comments →
import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int terms = scan.nextInt(); for(int i=0;i<terms;i++){ int a = scan.nextInt(); int b = scan.nextInt(); int n = scan.nextInt(); for(int j=0;j<n;j++){ a=a+(int)(Math.pow(2,j)*b); System.out.print(a+" "); } System.out.println(); } } }
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 →