変数を一つだけ使って1~100まで足す
「1から100までの和を表示するプログラムを作れ」という問題を鼻で笑う諸君、「但し変数は宣言済の int x 以外は使わないこと」 という条件を付けても鼻で笑っていられるかな?
— 自作中毒ぢぢぃ、GATAROさん (@duo6750) 3月 25, 2012
というのを見かけたのでintを16bitと8bitに区切って使って計算してみた。
using System; public class Program { public static void Main() { //0xFFFF00(5050) + 0xFF(100) int x = 100; for (; (x & 0xFF) > 0; x= x & 0xFFFF00 | ((x & 0xFF) -1)) { x = ((x >> 8) + (x & 0xFF)) << 8 | (x & 0xFF); } Console.WriteLine(x>>8); } }実行結果はこちら/ideone.com
The Casino Floor - Trick to Gamble | Trickster Tactoe
返信削除The Casino Floor features a 토토 와이즈 floor 안전 토토사이트 샤오미 of 1,600 slot machines, that allows you to 외국 라이브 enjoy playing 토토사이트 구축 유니벳 and win at the casino floor, or at the casino 벨라가르텐 lobby.