Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は家の割り当てに取り組んでいますが、それについて 1 つのことを理解していません。
(a < 0) ? 1 : -1
これは何を意味するのでしょうか?
これは基本的に、変数が 0 未満であるかということです。1なら1じゃないなら-1こんな感じ
if(a<0) 1 else -1