You are viewing a single comment's thread. Return to all comments →
Here's my code
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int q = s.nextInt(); for(int i=1;i<=q;i++){ int a = s.nextInt(); int b = s.nextInt(); int n = s.nextInt(); if(q>=0&&q<=500&&a>=0&&a<=50&&b>=0&&b<=50&&n>=1&&n<=15){ int sum = a; for(int j=0;j<n;j++){ sum = sum + ((int)Math.pow(2, j))*b; System.out.print(sum+" "); } 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 →
Here's my code