코드업 기초 100제 (81~90)

riyu_·2020년 12월 10일
0

코드업 기초 100제

목록 보기
9/10

1081

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        for(int i=1; i<=n; i++){
            for(int j=1; j<=m; j++){
                System.out.println(i + " " + j);
            }
        }
    }
}

1082

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String ch = sc.next();
        int n1 = Integer.valueOf(ch, 16);

        for(int i=1; i<16; i++){
            String n2 = Integer.toHexString(i).toUpperCase();
            String n3 = Integer.toHexString(n1*i).toUpperCase();
            System.out.println(ch+"*"+n2+"="+n3);
        }
    }
}

1083

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i=1; i<=n; i++){
            if( i== 3 | i==6 | i==9 ){
                System.out.print('X' + " ");
            }else{
                System.out.print(i + " ");
            }
        }
    }
}

1084

import java.io.*;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        String[] p = br.readLine().split(" ");
        int cnt = 0;
        for(int i=0; i<Integer.parseInt(p[0]); i++){
            for(int j=0; j<Integer.parseInt(p[1]); j++){
                for(int k=0; k<Integer.parseInt(p[2]); k++){
                    bw.write(i +" "+ j+" "+ k + "\n");
                    cnt++;
                }
            }
        }
        bw.write(Integer.toString(cnt));
        bw.flush();
    }
}

1085

import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        float h = sc.nextFloat();
        float b = sc.nextFloat();
        float c = sc.nextFloat();
        float s = sc.nextFloat();
        float sum = h * b * c * s;
        double mb = sum / 8 / 1024 / 1024;
        System.out.format("%.1f MB",mb);
    }
}

1086

import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        float w = sc.nextFloat();
        float h = sc.nextFloat();
        float b = sc.nextFloat();
        float sum = w * h * b;
        double mb = sum / 8 / 1024 / 1024;
        System.out.format("%.2f MB",mb);
    }
}

1087

import java.util.Scanner;

public class Main {

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

1088

import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i=1; i<=n; i++){
            if(i%3==0){
                continue;
            }
            System.out.print(i + " ");
        }
    }
}

1089

import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int d = sc.nextInt();
        int n = sc.nextInt();
        int sum = a;
        for(int i=1; i<n; i++){
            sum += d;
        }
        System.out.print(sum);
    }
}

1090

import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int d = sc.nextInt();
        int n = sc.nextInt();
        long sum = a;
        for(int i=1; i<n; i++){
            sum *= d;
        }
        System.out.print(sum);
    }
}

0개의 댓글

Powered by GraphCDN, the GraphQL CDN