2024.5.22 闲话
See You Again
It's been a long day without you my friend
And I'll tell you all about it when I see you again
We've come a long way from where we began
Oh I'll tell you all about it when I see you again
When I see you again
Wiz Khalifa:
D**n who knew
All the planes we flew
Good things we been through
That I'd be standing right here talking to you
'Bout another path
I know we loved to hit the road and laugh
But something told me that it wouldn't last
Had to switch up look at things different see the bigger picture
Those were the days hard work forever pays
Now I see you in a better place
See you in a better place
Uh
How could we not talk about family when family's all that we got
Everything I went through
You were standing there by my side
And now you gon' be with me for the last ride
Charlie Puth/Wiz Khalifa:
It's been a long day without you my friend
And I'll tell you all about it when I see you again
I'll see you again
We've come a long way
Yeah we came a long way
From where we began
You know we started
Oh
I'll tell you all about it when I see you again
I'll tell you
When I see you again
Charlie Puth:
Aah oh aah oh
Wooooh-oh-oh-oh-oh-oh
Yeah
Wiz Khalifa:
First you both go out your way and the vibe is feeling strong
And what's small turned to a friendship
A friendship turned to a bond
And that bond will never be broken
The love will never get lost
The love will never get lost
And when brotherhood come first
Then the line will never be crossed
Established it on our own when that line had to be drawn
And that line is what we reached so remember me when I'm gone
Remember me when I'm gone
Wiz Khalifa:
How could we not talk about family when family's all that we got
Everything I went through you were standing there by my side
And now you gon' be with me for the last ride
Charlie Puth:
So let the light guide your way yeah
Hold every memory as you go
And every road you take
Will always lead you home home
It's been a long day without you my friend
And I'll tell you all about it when I see you again
We've come a long way from where we began
Oh I'll tell you all about it when I see you again
When I see you again
Charlie Puth/Wiz Khalifa:
Aah oh aah oh
Uh
Yeah
Yeah
Wooooh-oh-oh-oh-oh-oh
Yo
When I see you again
Yo uh
See you again
Yo yo
Oh-oh
Uh-huh
Yup
When I see you again
第一篇闲话。
起因是调错保留位数调了 1h-
然后写这个写了 2h+
其实主要是想吧目录撑起来
括号里面是传参。
有的有 std::
前缀,是因为和变量名冲突会优先调用变量。
实在怕冲突可以都加上。
没说的修改大概都永久有效,没说 \(yes/no\) 的默认 no
。
cin
cout
语法唐氏:
cin
:
无特殊说明用法都是 cin.xxx(xxx)
。
-
setw(int)
用于分块输入和限制输入长度(只设置下一个)。用法
cin>>setw(int)>>xxx;
-
peek()
窥探下一个字符,但不读入。 -
putback(char)
将char
再放输入缓存(可以再读),很玄学,没搞懂,两次读取之间只放一个字符比较稳,不然可能寄。 -
unget()
撤销上一次字符的读入,只撤销一个字符,可多次使用(不要越界)。 -
gcount()
返回上次读入字符数量,会被大多数修改(包括unget()
等)改变或清空。 -
std::ws
清除所有前缀空白字符,一般用于cin
后接getline
时用getline(cin>>std::ws,xxx)
避免读入空白和回车。用法
cin>>std::ws;
-
get()
读入一个字符,早期没有char
时用于读入'7'
等 。 -
get(char*,int)
和下面的cin.getline
差不多,因为没有越界检查,建议用下面的。 -
getline(char*,int)
是cin.getline
哦,用于读入字符数组,int
是长度,和getline
一样不会忽略前缀空白字符。 -
read(char*,int)
一直读入,直到读了int
个或到文件尾。 -
std::hex,std::dec,std::oct
分别当做 \(16,10,8\) 读入整数,也可以直接用setbase(int)
,int
为 \(16,10,8\) 否则无效,默认dec
。用法
cin>>std::hex;
cin>>setbase(16);
-
(no)skipws
是否跳过空白字符,默认 \(yes\)用法
cin>>skipws;
-
quoted(string,char1,char2)
用于读入带分隔字符的字符串:string
读入串。char
分隔符,默认"
。char2
转义符,默认\
。用法
cin>>quoted(xxx,xxx,xxx)
。例子
#include <bits/stdc++.h> using namespace std; int main() { string a; cin >> quoted(a); cout << a; }
\(input\):
"this is a string, we can \"read\" it.
and it can in many lines."\(output\):
this is a string, we can "read" it
and it can in many lines.
更多可以参考 https://zh.cppreference.com/w/cpp/io/basic_istream
cout
:
无说明用法都是 cout<<xxx
std::hex,std::dec,std::oct,setbase(int)
同cin
。(no)showbase
在输出 \(16,8\) 进制时是否输出0x
,0
(no)showpoint
设置是否输出小数点后省略的末尾 \(0\)(no)uppercase
输出大(小)写,指0X2F5
(十六进制数)之类的(no)unitbuf
设置是否自动flush
setprecision(int)
设置浮点精度,具体以浮点数格式为准fixed
设置浮点数格式为定点(会保留到小数点后setprecision(int)
位,且不去末尾 \(0\))scientific
设置浮点数格式为科学计数法(转为科学计数法后保留到小数点后setprecision(int)
位,且不去末尾 \(0\))hexfloat
用 \(16\) 进制输出浮点数(没有 \(8\) 进制),会忽略其他对浮点数的指定,包括setprecision(int)
。defaultfloat
浮点数格式返回默认值,总共保留setprecision(int)
位有效数字(包括整数位),去除末尾 \(0\)。setw
设置宽度(只设置下一个)。setfill(char)
设置在宽度不满时的填充字符。std::left,std::right,std::internal
控制左,右,标号在左(如0x
)数字在右,默认right
。resetiosflags
重置,参数可传:ios::basefield
重置整数进制。ios::floatfield
重置浮点数格式。ios::adjustfield
重置对齐。
get_money/put_money/get_time/put_time
解析、输出货币、时间(不会用)。quoted(string,char,char)
同cin
更多可以参考 https://zh.cppreference.com/w/cpp/io/basic_ostream
求教教怎么放歌词
本文来自博客园,作者:xrlong,转载请注明原文链接:https://www.cnblogs.com/xrlong/p/18204998
版权声明:本作品采用 「署名-非商业性使用-相同方式共享 4.0 国际」许可协议(CC BY-NC-SA 4.0) 进行许可。