c#静态编译代码执行脚本代码关键字还会变色//debugitstepbystep(F10,F11)usingSystem;//forConsole.WriteLineusingSystem.Windows.Forms;//forMessageBox.Show,...usingSystem.Diagnostics;//forDebug.WriteLineusingSystem.Collections.Generic;//forList//wecancallstaticfunctionsMessageBox.Show("HelloWorld!");//outputtoDevStudioOutputConsole.WriteLine("HelloWorld!");//sameoutputoverDebugDebug.WriteLine("HelloWorld!");//wecandefineglobalvar'svaranystr="HelloWorld{0}{1}";intanynuber=1;floatanyfloat=3.14f;//andwecanuseitConsole.WriteLine(string.Format(anystr,anynuber,anyfloat));//wecanwritefunctionsstringtest1(inti,strings){ returns+""+i;}doubletest2(doublex){ doublet=Math.Sin(x);//withlocalvarsofcourse returnt*t;}
1