下面这段C#代码有几处错误,请指出并纠正。
using System;namespace ConsoleApplication1
{
class Program
{
private static const int factor = 100;
static void Main(string[] args)
{
if (args[0] == "")
{
for (int i = 0; i < 10; i++)
System.Console.WriteLine("{0}", GetPercent(factor, i));
}
else
{
System.Console.WriteLine("{0} {1}", args[0], args[1]);
}
}
private double CalPercent(int v1, int v2)
{
return v1 / v2 * 100;
}
}
}
下面这段JavaScript代码有几处错误,请指出并纠正。
function calTotal(ids,sgns) {
var t=0;
var idlist=ids.split(";");
var slist=sgns.split(";");
var f;
for (var i=1;i<= idlist.length;i++) {
f=eval("form1.v_"+id);
t+=parseInt(slist[i]])*100/f.value;
}
form1.v_total.value=t.toFixed(2);
}
这两段代码有什么错误啊
using System;namespace ConsoleApplication1
{
class Program
{
private static const int factor = 100;
static void Main(string[] args)
{
if (args[0] == "")
{
for (int i = 0; i < 10; i++)
System.Console.WriteLine("{0}", GetPercent(factor, i));
}
else
{
System.Console.WriteLine("{0} {1}", args[0], args[1]);
}
}
private double CalPercent(int v1, int v2)
{
return v1 / v2 * 100;
}
}
}
下面这段JavaScript代码有几处错误,请指出并纠正。
function calTotal(ids,sgns) {
var t=0;
var idlist=ids.split(";");
var slist=sgns.split(";");
var f;
for (var i=1;i<= idlist.length;i++) {
f=eval("form1.v_"+id);
t+=parseInt(slist[i]])*100/f.value;
}
form1.v_total.value=t.toFixed(2);
}
这两段代码有什么错误啊
作业还拿上来让别人帮你做?
作业还拿上来让别人帮你做?