我有这个MATLAB诅咒的作业。我14岁,我无法完全理解这个问题,因为我的英语技能。我想帮助解决这个问题。提前谢谢你。
function pr=prime(n)
答案 0 :(得分:6)
如果这是作业,我不会给你结果,但只是一些关于如何到达那里的想法。
您需要一个函数 static void SetInterface(string interfaceName, bool enable)
{
string type;
if (enable == true) type = "enable";
else type = "disable";
System.Diagnostics.ProcessStartInfo psi =
new System.Diagnostics.ProcessStartInfo("netsh", String.Format("interface set interface {0} {1}", interfaceName, type));
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo = psi;
p.Start();
}
,它将返回您刚才描述的内容。
示例输出:findmyprime()
findmyprime(2)
因为第一个素数是>> 5
,而2 3 5 7 9 ..
和p
是素数的第一个素数是5 = n = 2 。看到5是素数,5 + 2 = 7也是素数。