About Me

About Me : I have been working as a Software Engineer for various international companies for four years.Currently, I am working as a full stack Javascript developer in Petronas(Malaysia).

Skills

Skills • Javascript •Typescript •Python •C •Java •ReactJs • Redux • VueJs • NestJs • React Testing Library • Django• PostgreSQL • MySQL • NodeJs • Git • Docker • Jira • Visual Studio Code • Slack

শুক্রবার, ৩ জুলাই, ২০১৫

UVA 10523 - Very Easy Solution

import java.util.Scanner;
import java.math.BigInteger;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        while (input.hasNext()) {
            int n = input.nextInt();
            int a = input.nextInt();
            BigInteger A = BigInteger.valueOf(a);
            BigInteger sum = BigInteger.ZERO;
            for (int i = 1; i <= n; i++) {

                sum = sum.add(BigInteger.valueOf(i).multiply(A.pow(i)));

            }
            System.out.println(sum);

        }

    }

}

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন