第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

這樣不行嗎?

?for(int i=1;i<=7;i++)
??????????? {
??????????????? for(int j=1;j<=7;j++)
??????????????? {
??????????????? int x=1;
??????????????? int y=7;
????????????????? if(j==x||j==y)
????????????????? Console.Write("O");
????????????????? else
????????????????? Console.Write(".");
????????????????? x++;
????????????????? y--;
??????????????? Console.WriteLine();
??????????? }

正在回答

4 回答

內(nèi)循環(huán)是打印一行的字符,你定義的x在內(nèi)循環(huán)里自加,對應(yīng)的是該行里的每一個字符,跟for循環(huán)的自加就是一樣,這樣j就恒等于x,條件表達式恒為真,打印的每一個字符都是o

0 回復 有任何疑惑可以回復我~

??????? for(int x=1;x<8;x++)
??????????? {
??????????????? for(int y=1; y<8;y++)
??????????????? {
??????????????????? if(y==x||(x+y==8&&x!=4))
??????????????????? Console.Write("o");
??????????????????? else
??????????????????? Console.Write(".");
??????????????? }
??????????????? Console.WriteLine();
??????????? }

0 回復 有任何疑惑可以回復我~

for(int x=1;x<=7;x++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? for(int y=1;y<=7;y++)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? if(y==x||y==8-x)

? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? Console.Write("o");

? ? ? ? ? ? ? ? ? ? ? ? continue;

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? Console.Write(".");

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ?Console.WriteLine(" ");

? ? ? ? ? ? }//請完善代碼


1 回復 有任何疑惑可以回復我~

? ? ? ? ? ? int x = 1;

? ? ? ? ? ? int y = 7;

? ? ? ? ? ? for (int i = 1; i <= 7; i++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? for (int j = 1; j <= 7; j++)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? if (j == x || j == y)

? ? ? ? ? ? ? ? ? ? ? ? Console.Write("0");

? ? ? ? ? ? ? ? ? ? else

? ? ? ? ? ? ? ? ? ? Console.Write(".");

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? x++;

? ? ? ? ? ? ? ? y--;

? ? ? ? ? ? ? ? Console.WriteLine(" ");

? ? ? ? ? ? }//請完善代碼


0 回復 有任何疑惑可以回復我~
#1

ayanc

那個不是“0”,是“o”
2017-07-13 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
C#開發(fā)輕松入門
  • 參與學習       255662    人
  • 解答問題       1522    個

本門課程是C#語言的入門教程,將帶你輕松入門.NET開發(fā)

進入課程

這樣不行嗎?

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號