Console.WriteLine(x)与continue不能用在那里的,会发生冲突的。for (int i = 1; i <= 9;i++ ) { int y = i == 3 || i == 8 ? 1 : 2; Console.WriteLine(y); } Console.ReadKey();
using System;using System.Collections.Generic;using System.Text;namespace Test{ class Program { static void Main(string[] args) { for (int x = 1; x < 10; x++) { if (x == 3 || x == 8) ...
using System;using System.Collections.Generic;using System.Text;namespace Test{ class Program { static void Main(string[] args) { for (int x = 1; x < 10; x++) { if(x==3||x==8) ...