A+B问题  

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n1 = sc.nextInt();
        int n2 = sc.nextInt();

        System.out.println(n1 + n2);
    }
}

序列求和

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextInt();
        long sum = 0;
        for(long i = 1; i <= n; i++){
            sum += i;
        }
        System.out.println(sum);
    }
}

圆的面积 

import java.util.Scanner;

import static java.lang.Math.atan;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double PI = atan(1.0) * 4;
        System.out.printf("%.7f", n * n * PI);
    }
}

Fibonacci数列 

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] arr = new long[n];
        for(int i = 0; i < arr.length; i++){
            if(i == 0 || i == 1){
                arr[i] = 1;
            }
            if(i > 1){
                arr[i] = (arr[i - 1] + arr[i - 2]) % 10007;
            }
        }
        System.out.println(arr[n-1]);
    }
}
12-18 06:19