comment

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

関連記事

no image

map::find で、iterator の場所を探す方法

以下の例のプログラムでは、 探した iterator の場所から、map の終わりの場所までに対応する要素をコンソールに表示する。 例 #include <iostream> #include …

no image

c++ で std::vector を宣言時に初期化する方法

std::vector を宣言時に初期化することができる。 コンパイル時に、–std=c++11 のオプションを指定する。 例 #include <iostream> #includ …

no image

matplotlib で、縦横の罫線を引く方法

破線をカスタマイズする方法 以下では、dashes = [5,2,2,2] で、線5・空白2・線2・空白2の破線を指定している。 詳しくは次を参照。 https://matplotlib.org/st …

no image

python3 で整数の割り算、商と余りを求める方法

floor divisionを使う。 例 a = 15 // 7 b = 15 % 7 print(a) print(b) 結果 2 1

no image

python3 で、文字列の最後が特定の文字で終わるか判定する方法

endswith を使う。 例 str1 = “こんにちは” result1 = str1.endswith(“は”) result2 = str1.endswith(“わ”) print(resul …