이것저것

알고리즘 c++ 하는방법

clichy12 2019. 5. 17. 02:57
입출력
#include <bits/c++io.h>
#include <stdio.h>
#include <cstdio>
int n;
int main() {
    scanf("%d",&n);
    printf("hello C++! %d",n);
}
#include <iostream>
using namespace std;
int n;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(nullptr);
    cin >> n;
    cout << "hello C++! " << n;
}

endl  ,  \n  

endl은 출력 후 버퍼를 비우는 역할을 수행하기 때문에 많이 느리다.

 

using namespace std 에 대해서

 

배열 미리 최대범위까지 선언하는것과  배열 범위 입력받고 선언하는법

 

string 사용법