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)

  1. setw(int) 用于分块输入和限制输入长度(只设置下一个)。

    用法 cin>>setw(int)>>xxx;

  2. peek() 窥探下一个字符,但不读入。

  3. putback(char)char 再放输入缓存(可以再读),很玄学,没搞懂,两次读取之间只放一个字符比较稳,不然可能寄。

  4. unget() 撤销上一次字符的读入,只撤销一个字符,可多次使用(不要越界)。

  5. gcount() 返回上次读入字符数量,会被大多数修改(包括 unget() 等)改变或清空。

  6. std::ws 清除所有前缀空白字符,一般用于 cin 后接 getline 时用 getline(cin>>std::ws,xxx) 避免读入空白和回车。

    用法 cin>>std::ws;

  7. get() 读入一个字符,早期没有 char 时用于读入 '7' 等 。

  8. get(char*,int) 和下面的 cin.getline 差不多,因为没有越界检查,建议用下面的。

  9. getline(char*,int)cin.getline 哦,用于读入字符数组,int 是长度,和 getline 一样不会忽略前缀空白字符。

  10. read(char*,int) 一直读入,直到读了 int 个或到文件尾。

  11. std::hex,std::dec,std::oct 分别当做 16,10,8 读入整数,也可以直接用 setbase(int)int16,10,8 否则无效,默认 dec

    用法 cin>>std::hex; cin>>setbase(16);

  12. (no)skipws 是否跳过空白字符,默认 yes

    用法 cin>>skipws;

  13. 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

  1. std::hex,std::dec,std::oct,setbase(int)cin
  2. (no)showbase 在输出 16,8 进制时是否输出 0x0
  3. (no)showpoint 设置是否输出小数点后省略的末尾 0
  4. (no)uppercase 输出大(小)写,指 0X2F5 (十六进制数)之类的
  5. (no)unitbuf 设置是否自动 flush
  6. setprecision(int) 设置浮点精度,具体以浮点数格式为准
  7. fixed 设置浮点数格式为定点(会保留到小数点后 setprecision(int) 位,且不去末尾 0
  8. scientific 设置浮点数格式为科学计数法(转为科学计数法后保留到小数点后 setprecision(int) 位,且不去末尾 0
  9. hexfloat16 进制输出浮点数(没有 8 进制),会忽略其他对浮点数的指定,包括 setprecision(int)
  10. defaultfloat 浮点数格式返回默认值,总共保留 setprecision(int) 位有效数字(包括整数位),去除末尾 0
  11. setw 设置宽度(只设置下一个)。
  12. setfill(char) 设置在宽度不满时的填充字符。
  13. std::left,std::right,std::internal 控制左,右,标号在左(如 0x)数字在右,默认 right
  14. resetiosflags 重置,参数可传:
    1. ios::basefield 重置整数进制。
    2. ios::floatfield 重置浮点数格式。
    3. ios::adjustfield 重置对齐。
  15. get_money/put_money/get_time/put_time 解析、输出货币、时间(不会用)。
  16. quoted(string,char,char)cin

更多可以参考 https://zh.cppreference.com/w/cpp/io/basic_ostream

求教教怎么放歌词

posted @   5k_sync_closer  阅读(54)  评论(3编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示