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