mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-04 11:44:21 +00:00
Reformat the C# codes.
Disable creating new line before open brace.
This commit is contained in:
@@ -8,11 +8,9 @@ using NUnit.Framework;
|
||||
|
||||
namespace hello_algo.chapter_array_and_linkedlist;
|
||||
|
||||
public class list
|
||||
{
|
||||
public class list {
|
||||
[Test]
|
||||
public void Test()
|
||||
{
|
||||
public void Test() {
|
||||
|
||||
/* 初始化列表 */
|
||||
int[] numbers = new int[] { 1, 3, 2, 5, 4 };
|
||||
@@ -49,15 +47,13 @@ public class list
|
||||
|
||||
/* 通过索引遍历列表 */
|
||||
int count = 0;
|
||||
for (int i = 0; i < list.Count(); i++)
|
||||
{
|
||||
for (int i = 0; i < list.Count(); i++) {
|
||||
count++;
|
||||
}
|
||||
|
||||
/* 直接遍历列表元素 */
|
||||
count = 0;
|
||||
foreach (int n in list)
|
||||
{
|
||||
foreach (int n in list) {
|
||||
count++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user