int max = num[0];
string maxName = name[0];
for (int i = 0; i < num.Length; i++)
{
if (num[i] > max)
{
max = num[i];
maxName = name[i];
}
}
string maxName = name[0];
for (int i = 0; i < num.Length; i++)
{
if (num[i] > max)
{
max = num[i];
maxName = name[i];
}
}
for(int i=0;i<7;i++) {
for(int j=0;j<7;j++) {
if(i==j||i==6-j) {
Console.Write("O");
} else {
Console.Write(".");
}
}
Console.WriteLine();
}
for(int j=0;j<7;j++) {
if(i==j||i==6-j) {
Console.Write("O");
} else {
Console.Write(".");
}
}
Console.WriteLine();
}
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