請(qǐng)大家看一看
using System; using System.Collections.Generic; using System.Text; namespace Test { ? ?class Program ? ?{ ? ? ? ?static void Main(string[] args) ? ? ? ?{ ? ? ? ? ? ?double x = 3.5; ? ? ? ? ? ?int y = 3; ? ? ? ? ? ?Console.WriteLine((int)x=y); ? ? ? ?} ? ?} } 這樣不可以嗎?
2017-06-07
給x取整數(shù)不是那樣的,還要用括號(hào)把x和int括起來(lái),這樣? ((int)x) == y,還有一個(gè)問(wèn)題,一個(gè)等號(hào)“=”是賦值,不是判斷,兩個(gè)和三個(gè)等號(hào)才是判斷,這樣 x==y;?? x===y;
2016-07-08
把“=”換成“==”試試
2016-05-12
2016-05-01
強(qiáng)制轉(zhuǎn)換不可以嗎?
2016-04-30
不可以,int不能賦值給double