Skip to content

Commit

Permalink
添加第二题
Browse files Browse the repository at this point in the history
  • Loading branch information
corporal9736 committed Aug 3, 2023
1 parent 31137f1 commit e41a9d6
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,37 @@ int main(){
## 标准答案


## `02`
日期:**`2023/7/22`** 出题人:**`mq白`**
给出代码:
```cpp
int main(){
std::cout << "乐 :{} *\n"_f(5);
std::cout << "乐 :{0} {0} *\n"_f(5);
std::cout << "乐 :{:b} *\n"_f(0b01010101);
std::cout << "{:*<10}"_f("卢瑟");
std::cout << '\n';
int n{};
std::cin >> n;
std::cout << "π:{:.{}f}\n"_f(std::numbers::pi_v, n);
}
```
### 运行结果:
```
乐 :5 *
乐 :5 5 *
乐 :1010101 *
卢瑟******
6
π:3.141593
```
6为输入,决定π的小数点后的位数,可自行输入更大或更小数字。
提示:C++11用户定义字面量,C++20format库。
难度:**二星**

## 群友提交

<br>

## 标准答案

0 comments on commit e41a9d6

Please sign in to comment.