Desc :

cin >> 변수 : 콘솔창을 통해 입력받아 해당 변수에 할당함

 

cout << : 콘솔창을 통해 출력

 

endl : 콘솔창 커서를 한 줄 밑으로 내린다

 


Source Code :

#include <iostream>

using namespace std;

int main()
{
	int number = 0;

	cin >> number;

	cout << "입력한 숫자는 " << number << " 입니다." << endl;

	return 0;
}

 


Result :

'C++' 카테고리의 다른 글

[C++] 006 사칙연산 축약  (0) 2021.01.22
[C++] 005 사칙연산  (0) 2021.01.22
[C++] 004 상수  (0) 2021.01.22
[C++] 003 변수  (0) 2021.01.22
[C++] 001 C++ 시작  (0) 2021.01.22

+ Recent posts