Drkcore

11 05 2008 cpp Tweet

c++の<?=という演算子

topcoderのsrm151 DIV2の250点問題の他のヒトの解答をみていたらみつけた。

#include<iostream>

using namespace std;
int main(){
  int result = 5;
  result <?= 3; // 3
  cout << result << endl;
}

条件に合致する場合に代入する演算子。コンパイルしたら警告がでた。

warning: minimum/maximum operators are deprecated

他にはstringはfind,substrというメソッドがあってperlと似たような感じで文字列操作ができるということを知った。

というか、文字列操作の比較表: Ruby, Python, JavaScript, Perl, C++が便利。

About

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

Tag

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

Ad

© kzfm 2003-2021