반응형

백준 9654번 나부 함대 데이터 풀이 코드

C | C++ | Java | Python


풀이

공백에 유의하며 제시 문장을 출력합니다.

코드

#include <stdio.h>
int main() {
    printf("SHIP NAME      CLASS          DEPLOYMENT IN SERVICE\n");
    printf("N2 Bomber      Heavy Fighter  Limited    21        \n");
    printf("J-Type 327     Light Combat   Unlimited  1         \n");
    printf("NX Cruiser     Medium Fighter Limited    18        \n");
    printf("N1 Starfighter Medium Fighter Unlimited  25        \n");
    printf("Royal Cruiser  Light Combat   Limited    4         \n");
    return 0;
}
#include <iostream>
using namespace std;
int main() {
    cout << "SHIP NAME      CLASS          DEPLOYMENT IN SERVICE" << endl;
    cout << "N2 Bomber      Heavy Fighter  Limited    21        " << endl;    
    cout << "J-Type 327     Light Combat   Unlimited  1         " << endl;
    cout << "NX Cruiser     Medium Fighter Limited    18        " << endl;
    cout << "N1 Starfighter Medium Fighter Unlimited  25        " << endl;
    cout << "Royal Cruiser  Light Combat   Limited    4        " << endl;
    return 0;
}
public class Main {
    public static void main(String[] args) {
        System.out.println("SHIP NAME      CLASS          DEPLOYMENT IN SERVICE");
        System.out.println("N2 Bomber      Heavy Fighter  Limited    21        ");
        System.out.println("J-Type 327     Light Combat   Unlimited  1         ");
        System.out.println("NX Cruiser     Medium Fighter Limited    18        ");
        System.out.println("N1 Starfighter Medium Fighter Unlimited  25        ");
        System.out.println("Royal Cruiser  Light Combat   Limited    4         ");
    }
}
print("SHIP NAME      CLASS          DEPLOYMENT IN SERVICE")
print("N2 Bomber      Heavy Fighter  Limited    21        ")
print("J-Type 327     Light Combat   Unlimited  1         ")
print("NX Cruiser     Medium Fighter Limited    18        ")
print("N1 Starfighter Medium Fighter Unlimited  25        ")
print("Royal Cruiser  Light Combat   Limited    4         ")

문제 출처

https://www.acmicpc.net/problem/9654

반응형

+ Recent posts