using System;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string[] a = { "关羽", "张飞", "赵云", "马超", "黄忠" };
foreach (var i in a)
{
Console.Write(i+",");
}
}
}
}
namespace Test
{
class Program
{
static void Main(string[] args)
{
string[] a = { "关羽", "张飞", "赵云", "马超", "黄忠" };
foreach (var i in a)
{
Console.Write(i+",");
}
}
}
}
bool has7Bei=false;
foreach(int x in num){
if(x%7==0){
has7Bei=true;
break;
}
}
if(has7Bei)
Console.Write("有七的倍数");
else
Console.Write("没有7的整倍数");
foreach(int x in num){
if(x%7==0){
has7Bei=true;
break;
}
}
if(has7Bei)
Console.Write("有七的倍数");
else
Console.Write("没有7的整倍数");
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
if(x>y-1)
break;
}
Console.WriteLine();//换行
}
{
for (int x = 1; x <= 7; x++)
{
Console.Write(x);
if(x>y-1)
break;
}
Console.WriteLine();//换行
}
2021-02-17
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
2021-02-08
已采纳回答 / 和你熟
for (int a = 0; a < 10; a++) { for (int b = 0; b < 10; b++) { if ((a != 0 && a != 9) && (b != 0 && b != 9)) Console.Write(' '); ...
2021-01-31
{ if (x >= 5) {Console.WriteLine("5" }else { if (y >= 6) { Console.WriteLine("6"); }else
{
Console.WriteLine("7");
}
}
}
else
{
Console.WriteLine("6");
}
{
Console.WriteLine("7");
}
}
}
else
{
Console.WriteLine("6");
}
2021-01-28
最新回答 / 慕标6286552
{吴松,钱东宇,伏晨,陈陆,周蕊,林日鹏,何昆,关欣} 每个字符串都没加"" int k=i; int K上面定于过了就补丁重复定义了score[k] 变量名score上面没定义过 应该改为name[K]
2021-01-24
已采纳回答 / 阔狗阔落
第一个for循环后面少了一个{,所以下面换行的语句就没起到作用static void Main(string[] args) { for (int y = 1; y <= 3; y++){ for (int x = 1; x <= y+2; x++) { Console.Write(x); } Console.WriteLine(); ...
2021-01-23
最新回答 / 至尊丶龙猫
string[] name=new string[] {"景珍","林惠洋","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"}; int [] score=new int[] {90,65,88,70,46,81,100,68}; int sum=0,avg; for(int i=0;i<score.Length;i++){ sum+=score[i]; } ...
2021-01-09