Visual Studio 2008 Part 18at TECH
Visual Studio 2008 Part 18 - 暇つぶし2ch21:デフォルトの名無しさん
09/09/03 20:52:31
>>18
using System;
namespace sosuu {
class Program {
static void Main(string[] args) {
bool[] buf = new bool[1000];
for (int i=0; i<buf.Length; i++) buf[i]=true;
for (int i=2; i<=buf.Length; i++) for (int j=i*2; j<=buf.Length; j+=i) buf[j-1]=false;
for (int i=0; i<buf.Length; i++) if (buf[i]) Console.Out.WriteLine(i+1);
}
}
}


次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch