Drkcore

20 05 2008 perl cpp Tweet

c++で文字列の繰り返し

perlだと

say "abc" x 3 # abcabcabc

と書けるところをc++だと

string ret = "";
for(int i=0;i<3;i++) ret += "abc";
cout << ret << endl;

と書かないといけないのか?

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021