#include <iostream> // cout, cin, endl, ....
#include <cstdio> // prinf
int main()
{
using namespace std; //네임스페이스 std를 사용하면 std::를 생략할 수 있다
int x = 1024;
double pi = 3.141592;
cout << "I love this lecture!\n"; //<< std::endl;
cout << " x is " << x << " pi is " << pi << endl;
cout << "abc" << "\t" << "def" << endl;
cout << "ab" << "\t" << "cdef" << endl;
cout << "\a";
//prinf("I love this lecture!\n")
return 0;
}
스트림 입출력을 사용해 문자열을 출력함.
-Knowledge
\t: 문자열 사이에 공백을 만들 수 있음.
\a: 컴퓨터가 알림음을 내게 함.
'Computer Science > C++' 카테고리의 다른 글
C++ -5- 홀수 짝수 판별 프로그램 (0) | 2021.04.07 |
---|---|
C++ -4- While 반복문과 함수를 이용한 간단한 덧셈 계산기 (0) | 2021.04.05 |
C++ -3- 함수와의 첫 만남 (0) | 2021.04.05 |
C++ -1- 변수와의 첫 만남 (0) | 2021.04.04 |
C++ -0- Visual Studio 2019를 사용해 Hello World 출력 (0) | 2021.04.03 |
댓글