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設置是否自動flushsetprecision(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,轉載請注明原文鏈接:http://www.rzrgm.cn/xrlong/p/18204998
版權聲明:本作品采用 「署名-非商業性使用-相同方式共享 4.0 國際」許可協議(CC BY-NC-SA 4.0) 進行許可。

浙公網安備 33010602011771號