Visual Studio 2008 Part 18at TECH
Visual Studio 2008 Part 18 - 暇つぶし2ch33:デフォルトの名無しさん
09/09/03 23:00:50
>>32 了解
Imports System.Diagnostics
Imports System.IO
Module Module1
Sub Main()
Dim sw As StreamWriter
sw = File.AppendText("Program.cs")
sw.WriteLine("using System;")
sw.WriteLine("namespace sosuu {")
sw.WriteLine(" class Program {")
sw.WriteLine(" static void Main(string[] args) {")
sw.WriteLine(" bool[] buf = new bool[10000 + 1];")
sw.WriteLine(" for (int i=0; i<buf.Length; i++) buf[i]=true;")
sw.WriteLine(" for (int i=2; i<=buf.Length; i++) for (int j=i*2; j<=buf.Length; j+=i) buf[j-1]=false;")
sw.WriteLine(" for (int i=1; i<buf.Length; i++) if (buf[i]) Console.Out.WriteLine(i+1);")
sw.WriteLine(" }")
sw.WriteLine(" }")
sw.WriteLine("}")
sw.Close()
Process.Start("c:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe /t:exe Program.cs")
Dim i As Integer : For i = 1 To 10 : Next
Process.Start("Program.exe")
End Sub
End Module


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