Drkcore

27 04 2008 cpp Tweet

vectorの要素中最大のものを選ぶ

ソートした最後の要素

  sort( nums.begin(), nums.end());
  cout << nums[nums.size() -1];

よくわからんが、こんな感じにもかける。

  vector<int>::iterator where  = max_element( nums.begin(), nums.end());
  cout << *where << endl;

あとで読む

About

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

Tag

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

Ad

© kzfm 2003-2021