最新回答 / 慕的地0236682
while( ( ch=getchar()!='\n' ) )→while( ( ch=getchar() )!='\n' )小伙子写程序要缩进,不然都懒得看你写的代码
2021-03-19
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
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