comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

gcc の -O オプション

gcc を使ってコンパイルする際、コンパイルのコマンドに、「-O」(アルファベットのオー、ゼロではない)オプションをつける。 コンパイル結果のファイルを最適化(optimization)することができ …

no image

matplotlib で、矢印を描く方法

arrowprops のパラメータは次を参考にして設定できる。 https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.FancyAr …

no image

python3 で数字をゼロ埋めして表示する

string の、zfill を使う。 例 n = 3 n0 = str(n).zfill(10) print(n0) 結果 0000000003

no image

python3 で文字列のリストを結合して1つの文字列にする方法

リストに対して、join メソッドを実行する。 例 list1 = [‘hello, ‘,’good ‘, ‘morning’] str1 = ”.join(list1) print(str1) 結 …

no image

std::map の内容が空かどうか判定する方法

map の中身が空であるかどうかには、empty() を使う。 map の要素を消去するには、erase を使う。 例 #include <iostream> #include <map> …