string text[9] = {"直接插入", "折半插入", "希尔排序", "冒泡排序","快速排序", "选择排序", "堆排序", "归并排序"}; [Error] 'string' was not declared in this scope
时间: 2023-12-21 15:31:31 浏览: 74
在C#中,字符串数组的声明应该使用关键字`string[]`而不是`string`。所以正确的声明应该是`string[] text = {"直接插入", "折半插入", "希尔排序", "冒泡排序","快速排序", "选择排序", "堆排序", "归并排序"};`。以下是修正后的代码示例:
```csharp
string[] text = {"直接插入", "折半插入", "希尔排序", "冒泡排序","快速排序", "选择排序", "堆排序", "归并排序"};
```
阅读全文