2023.7.3

发布时间 2023-07-03 17:57:08作者: 牟兆迪
## 输入带空格的字符串

~~~ c++
1.
#include <string.h>
string s;
getline(cin,s);

2.
#include <cstring>
#include <stdio.h>
char a[1024];
gets(a);
int len = strlen(a);//得到数组的实际长度

~~~

## 填充输入

~~~java
setw(int n)//用来控制输出间隔
//例:cout<<'s'<<setw(3)<<'a'<<endl;
setfill(char c)//用来填充输出
//例:cout<<setfill('*')<<setw(3)<<'a'<<endl;
    //输出为:**a
~~~