망나니 AWOS의 일상
article thumbnail

1단계 2739번 구구단

import java.util.Scanner;

class Main{
    public static void main(String []args){
        Scanner sc = new Scanner(System.in);
        
        int a = sc.nextInt();
        
        for(int i=1; i<10; i++){
            System.out.println(a+" * "+i+" = "+a*i);
        }
    }
}

2단계 10950번 A + b - 3

import java.util.Scanner;

class Main{
    public static void main(String []args){
        Scanner sc = new Scanner(System.in);
        int c = sc.nextInt();
        int a[] = new int[c];
        int b[] = new int[c];
     
        for(int i=0; i<c; i++){
            a[i]= sc.nextInt();
            b[i]= sc.nextInt();
        }
        for(int i=0; i<c; i++){
            System.out.println(a[i]+b[i]);   
        }
    }
}

3단계 8393번 합

import java.util.Scanner;

class Main{
    public static void main(String[] args){        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int tot = 0;
        
        for(int i=n; i>0; i--)
            tot += i;
        System.out.println(tot);
    }
}
profile

망나니 AWOS의 일상

@AWOS

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!