for(int y=7;y>=1;y--)
{
for(int x=1;x<=7;x++)
{
if(x==y||x+y==8)
Console.Write("0");
else
Console.Write(".");
}
Console.WriteLine();
}
过不了啊过不了
{
for(int x=1;x<=7;x++)
{
if(x==y||x+y==8)
Console.Write("0");
else
Console.Write(".");
}
Console.WriteLine();
}
过不了啊过不了
bool hasBeishu = false;
for (int i = 0; i < num.Length;i++) {
if (num[i] % 7 == 0){
hasBeishu = true;
break; } }
if (hasBeishu)
Console.WriteLine("有7的整倍数");
else
Console.WriteLine("没有7的整倍数");
for (int i = 0; i < num.Length;i++) {
if (num[i] % 7 == 0){
hasBeishu = true;
break; } }
if (hasBeishu)
Console.WriteLine("有7的整倍数");
else
Console.WriteLine("没有7的整倍数");
自己写名字数组int[]score=newint[]{90,65,88,70,46,81,100,68};intmax=0,avg;for(inti=0;i<score.Length;i++){max+=score[i];}avg=max/score.Length;Console.WriteLine("平均分是"+avg+",高于平均分的有:");
for(inti=0;i<score.Length;i++){if(avg<score[i]){Console.Write(name[i]+"");}}Console.Read();
for(inti=0;i<score.Length;i++){if(avg<score[i]){Console.Write(name[i]+"");}}Console.Read();
string[] jiangjun=new string[5]{"关羽","张飞","赵云","马超","黄忠"};
foreach(string temp in jiangjun)
{
Console.Write(temp+",");
}
foreach(string temp in jiangjun)
{
Console.Write(temp+",");
}
int[] score = new int[] { 89, 90, 98, 56, 60 }; string[] name = new string[] { "吴松", "钱东宇", "伏晨", "陈陆", "周蕊" }; int max = score[0]; string mz = name[0]; for (int i = 1; i < 8; i++) if (score[i] > max){max = score[i]; mz = name[i]; } Console.WriteLine("分数最高的是{0},分数是{1}", mz, max); Console.Read();