jjzjj

c# - 整数求和布鲁斯,short += short 问题

C#程序:shorta,b;a=10;b=10;a=a+b;//Error:Cannotimplicitlyconverttype'int'to'short'.//wecanalsowritethiscodebyusingArithmeticAssignmentOperatorasgivenbelowa+=b;//Butthisisrunningsuccessfully,why?Console.Write(a); 最佳答案 这里有两个问题。第一个是“为什么short加short的结果是int?”好吧,假设short加short是sh