hahahahahah 笑死我了
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
int x=1;
bool a = ++x * x > 3;
Console.WriteLine(a);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
int x=1;
bool a = ++x * x > 3;
Console.WriteLine(a);
}
}
}
2022-11-08
int x = 5;
int y = 5;
int z = 5;
Console.Write(++x);
Console.Write(++y);
Console.Write(++z);
int y = 5;
int z = 5;
Console.Write(++x);
Console.Write(++y);
Console.Write(++z);
2022-10-14
程序先運(yùn)行外部框架,把輸入值為5的程序置于輸出值為6的框架內(nèi)部,使得先運(yùn)行輸出值為6的即可
2022-09-29
{if (x >= 5)
{ Console.WriteLine("5");
}
}
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
}
}
}
{ Console.WriteLine("5");
}
}
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
}
}
}
2022-09-29
static void Main(string[] args)
{
for(int i=0;i<7;i++)
{
for(int j=0;j<7;j++)
{
char text = (j==i || j==6-i)?'O':'.';
Console.Write(text);
}
Console.WriteLine();
}
{
for(int i=0;i<7;i++)
{
for(int j=0;j<7;j++)
{
char text = (j==i || j==6-i)?'O':'.';
Console.Write(text);
}
Console.WriteLine();
}
2022-09-23
string[,] list = new string[,]{{"吳松","89"},{"錢東宇","90"},{"伏晨","98"},{"陳陸","56"},{"周蕊","60"},{"林日鵬","91"},{"何昆","93"},{"關(guān)欣","85"}}; string name = ""; int score = 0;for (int i = 0; i < list.GetLength(0)-1; i++) {if (int.Parse(list[i, 1]) > score) {name = list[i, 0];score = int.Parse(list[i, 1]);}};
2022-09-04
string[,] nameScoreArr = new string[4,2]{{"吳松","89"},{"錢東","90"},{"周蕊","98"},{"關(guān)欣","78"}};
int maxIndex = 0;
for (int x=1;x<nameScoreArr.GetLongLength(0);x++) {
if (int.Parse(nameScoreArr[x,1]) > int.Parse(nameScoreArr[maxIndex,1])) {
maxIndex = x;
}
}
int maxIndex = 0;
for (int x=1;x<nameScoreArr.GetLongLength(0);x++) {
if (int.Parse(nameScoreArr[x,1]) > int.Parse(nameScoreArr[maxIndex,1])) {
maxIndex = x;
}
}
2022-08-29
switch的方法有點(diǎn)簡(jiǎn)單,應(yīng)該再詳細(xì)說明一下,比如case的的語(yǔ)句塊{}以及不加語(yǔ)句塊的區(qū)別,加了語(yǔ)句塊 可以申明局部相同的變量等。。
2022-08-24
{ string today;//今天的午飯
string tomorrow;//明天的午飯
string temp;
today = "魚香肉絲";
tomorrow = "小雞燉蘑菇";
temp=tomorrow;
tomorrow=today;
today=temp;
//請(qǐng)?jiān)谶@里補(bǔ)充代碼,實(shí)現(xiàn)變量today和tomorrow的交換
這樣子交換是不是不臺(tái)符合邏輯啊,雖然也成功了
string tomorrow;//明天的午飯
string temp;
today = "魚香肉絲";
tomorrow = "小雞燉蘑菇";
temp=tomorrow;
tomorrow=today;
today=temp;
//請(qǐng)?jiān)谶@里補(bǔ)充代碼,實(shí)現(xiàn)變量today和tomorrow的交換
這樣子交換是不是不臺(tái)符合邏輯啊,雖然也成功了
2022-07-29
要注意定義變量之后,要給變量進(jìn)行賦值,否則會(huì)報(bào)錯(cuò):“該變量為局部變量”,還有注意if 語(yǔ)句的包含區(qū)域,要把該包含的內(nèi)容用中括號(hào)括起來,注意這些!!
2022-06-29