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

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

正在回答

5 回答

?for(int i = 0;i<7;i++){

? ? ? ? ? ? ? ? for(int j = 0;j<7;j++){

? ? ? ? ? ? ? ? ? ? if(j==i||i+j==6){

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

? ? ? ? ? ? ? ? ? ? }else{

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

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? Console.WriteLine();//換行

? ? ? ? ? ? }

0 回復(fù) 有任何疑惑可以回復(fù)我~

https://img1.sycdn.imooc.com//5ae07aa50001bf5c04920263.jpg

你這里是因為運算符的優(yōu)先級關(guān)系,“-”運算符的優(yōu)先級本來就要高于“==”運算符,把(8-x)的括號去掉就對了,希望能幫到你

0 回復(fù) 有任何疑惑可以回復(fù)我~

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;


namespace Test01

{

? ? class Program

? ? {

? ? ? ? static void Main(string[] args)

? ? ? ? {

? ? ? ? ? ? const int n = 7;

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

? ? ? ? ? ? {

? ? ? ? ? ? ? ? for (int x = 1; x <= n; x++)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? if (x == y || x == n - y + 1)

? ? ? ? ? ? ? ? ? ? {

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

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? else

? ? ? ? ? ? ? ? ? ? {

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

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? }

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

? ? ? ? ? ? }

? ? ? ? }

? ? }

}


0 回復(fù) 有任何疑惑可以回復(fù)我~

const n = 7

for(y =1~n){

? for(x =1~n){

? ? if(x==y || x==n-y+1){

? ? ?output(0);

? ? }

? ? output(*);

? }

? Change line;


0 回復(fù) 有任何疑惑可以回復(fù)我~


??????????? for(int x=1;x<=7;x++)//循環(huán)行數(shù)
??????????? {
???????????????
??????????????? for(int dot=1;dot<=7;dot++)//循環(huán)位數(shù)(位置從左到右為1234567)
??????????????? {
??????????????????? if (dot == x || dot == (8 - x))//判定位置,因為0為對稱位置,即8(最大位數(shù))減當(dāng)前位置可以得到之后位置。舉個例子,第一行第一個0在1位,所以第二個0在(8-1)=7位。
??????????????????????? Console.Write("O");
??????????????????? else
??????????????????????? Console.Write(".");//其他位置打印“.”
??????????????? }
??????????????? Console.WriteLine();//換行
??????????? }

初學(xué)乍道,望各位大佬不吝賜教!

1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

俊醬 提問者

謝謝哦
2018-04-11 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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