.at
string :: at
文字列の位置posにある文字 への参照を返します。 この関数は、posが文字列内の文字の有効な位置であるかどうか(つまり、posが文字列の長さよりも小さいかどうか)を自動的にチェックし、そうでない場合はout_of_range例外をスローします。
参考:
https://paiza.io/projects/HuiK-lRtX4drxpsuNifQCw
https://www.cplusplus.com/reference/string/string/at/
size
https://cpprefjp.github.io/reference/vector/vector/size.html