bool has7Bei=false;
foreach(int x in num){
if(x%7==0){
has7Bei=true;
break;
}
}
if(has7Bei)
Console.Write("有七的倍數(shù)");
else
Console.Write("沒有7的整倍數(shù)");
foreach(int x in num){
if(x%7==0){
has7Bei=true;
break;
}
}
if(has7Bei)
Console.Write("有七的倍數(shù)");
else
Console.Write("沒有7的整倍數(shù)");
2021-02-18
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
最新回答 / 慕標(biāo)6286552
{吳松,錢東宇,伏晨,陳陸,周蕊,林日鵬,何昆,關(guān)欣}? 每個字符串都沒加""?int k=i; int K上面定于過了就補丁重復(fù)定義了score[k]? 變量名score上面沒定義過 應(yīng)該改為name[K]
2021-01-24
最新回答 / weixin_慕虎1420592
score.Length返回的是數(shù)組元素個數(shù),數(shù)組元素從0開始,循環(huán)條件到score.Length-1是數(shù)組最后一個元素,所已不能包括等于
2021-01-24
已采納回答 / 闊狗闊落
第一個for循環(huán)后面少了一個{,所以下面換行的語句就沒起到作用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
bool hasno=false;
for(int i=0;i<num.Length;i++)
{
if(num[i]%7==0)
hasno=true;
}
if(hasno)
{Console.Write("有7的整倍數(shù)");
}
else
{
Console.Write("沒有7的整倍數(shù)");
for(int i=0;i<num.Length;i++)
{
if(num[i]%7==0)
hasno=true;
}
if(hasno)
{Console.Write("有7的整倍數(shù)");
}
else
{
Console.Write("沒有7的整倍數(shù)");
2021-01-16
最新回答 / 至尊丶龍貓
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