Browse Source

docs: 📝 update fmt tutor

tags/0.1.0
DragonAura 3 years ago
parent
commit
c903fdbfaa
1 changed files with 19 additions and 0 deletions
  1. +19
    -0
      docs/Tool_tutorial.md

+ 19
- 0
docs/Tool_tutorial.md View File

@@ -244,6 +244,25 @@ for (auto itr = begin(arr); itr != end(arr); ++itr)



### fmt库的使用



选手包中内置了`fmt`库,因此选手可以通过`fmt`库来格式化字符串,而无须自己手动格式化。

```c++
std::string str_std = "number: " + std::to_string(1) + teststr;
std::string str_fmt = fmt::format("number: {}{}", 1, teststr); // 两种方法等价
```



`fmt`库还支持更多强大的操作,例如更精确的格式化、更简便的转化等。

更多用法参见(点击进入):[fmt_index](https://fmt.dev/latest/index.html)。



## Python接口必看

比赛**只保证!!**支持Python3.9,不保证支持其他版本


Loading…
Cancel
Save