Share c++ getline

lamtruongduong

New member
`` `C ++
#include <Istream>
#include <String>

sử dụng không gian tên STD;

int main () {
// Xác định một biến chuỗi để lưu trữ dòng đầu vào.
chuỗi chuỗi;

// Nhận dòng đầu vào từ người dùng.
cout << "Nhập một dòng văn bản:";
getline (cin, dòng);

// In dòng đầu vào vào bảng điều khiển.
cout << "Bạn đã nhập dòng sau:" << dòng << endl;

trả lại 0;
}
`` `

## 5 hashtag ở dạng #

* #C ++
* #Theo hàng
* #sợi dây
* #Đầu vào
* #console
=======================================
```c++
#include <iostream>
#include <string>

using namespace std;

int main() {
// Define a string variable to store the input line.
string line;

// Get the input line from the user.
cout << "Enter a line of text: ";
getline(cin, line);

// Print the input line to the console.
cout << "You entered the following line: " << line << endl;

return 0;
}
```

## 5 Hashtags in the form of #

* #C++
* #Getline
* #String
* #input
* #console
 
Join Telegram ToolsKiemTrieuDoGroup
Back
Top