我正在編寫代碼,但出現錯誤 - 缺少名稱空間或程序集引用。是否存在代碼錯誤或者我錯過了某些內容?錯誤缺少名稱空間或程序集引用
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
int i = 0;
int sum = 0;
int[] arr = new int[] { 1, 2 };
do
{
{
sum += arr[1];
Console.WriteLine("Wow");
i++;
}
}
while (i < 3);
}
}
}
錯誤是:錯誤不能用集合初始化初始化類型「詮釋」,因爲它沒有實現「System.Collections.IEnumerable
你有什麼「使用」聲明? – elyashiv 2012-08-15 06:08:30
使用系統; using System.Collections.Generic;使用System.Linq的 ; using System.Text; 添加這些和您的問題應該解決使用系統 – 2012-08-15 06:10:00
;應該夠了。 – elyashiv 2012-08-15 06:10:34