课评: 转出学生归档(王子墨/张立坤/黄俊博)+ 周四班级总结 + 新生章梓皓档案 + C++示例代码
This commit is contained in:
21
C++代码/学习/未命名1.cpp
Normal file
21
C++代码/学习/未命名1.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <bits/stdc++.h>
|
||||
#define endl '\n'
|
||||
using namespace std;
|
||||
|
||||
string str;
|
||||
|
||||
int main(){
|
||||
// 两种读入
|
||||
// cin >> str; // 局限:遇到空格就结束
|
||||
|
||||
getline(cin, str);
|
||||
|
||||
// cout << str;
|
||||
|
||||
// int len = str.size(); // 字符串.size(); 可以获得字符串的长度
|
||||
for(char c : str){
|
||||
cout << c << " ";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user