[TIL] 211007

Jaewon·2021년 10월 7일
0

TIL

목록 보기
9/11
post-custom-banner

1. C++ 기초 연습

#include <iostream>
using namespace std;

int main() {
    int N;
    cin >> N;
    for (int i = 1; i < 10; i++){
        cout << N << " * " << i << " = " << N*i << "\n";
    }
}

💡 "\n"; 까먹지 말기!!

#include <iostream>
using namespace std;

int main() {
    int T;
    cin >> T;
    int A, B;
    for (int i = 0; i < T; i++){
        cin >> A >> B;
        cout << A + B << "\n";
    }
}
#include <iostream>
using namespace std;

int main() {
    int N;
    cin >> N;
    int sum = 0;
    for (int i = 0; i < N+1; i++){
        sum += i;
    }
    cout << sum << "\n";
}
코드를 입력하세요
#include <iostream>
using namespace std;

int main() {
    int N;
    cin >> N;
    for (int i = 1; i < N+1; i++){
        cout << i << "\n";
    }
    
}
#include <iostream>
using namespace std;

int main() {
    int T;
    cin >> T;
    int A, B;
    for (int i = 1; i < T + 1; i++){
        cin >> A >> B;
        cout << "Case #" << i << ": " << A+B << "\n";
    }
    
}
#include <iostream>
using namespace std;

int main() {
    int A , B;
    while (cin >> A >> B){
        cout << A+B << "\n";
    }
    
}
post-custom-banner

0개의 댓글