c++常用读取

时间:2020-06-07 17:59:40   收藏:0   阅读:37
 1 #include <iostream>
 2 
 3 using namespace std;
 4 
 5 int main()
 6 {
 7     string s;
 8     int i;
 9     cin >> i;    // 读取一个数字
10     cin.get();   // 读取换行
11     getline(cin,s);    // 读取一行
12     return 0;
13 }

 

原文:https://www.cnblogs.com/limancx/p/13061349.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!