Dart语言算术运算符

void main() { 
   var num1 = 101; 
   var num2 = 2; 
   var res = 0; 
   res = num1+num2; 
   print("Addition: ${res}"); 
   res = num1-num2;
   print("Subtraction: ${res}"); 
   res = num1*num2; 
   print("Multiplication: ${res}"); 
   res = num1/num2; 
   print("Division: ${res}"); 
   res = num1~/num2; 
   print("Division returning Integer: ${res}"); 
   res = num1%num2; 
   print("Remainder: ${res}"); 
   num1++; 
   print("Increment: ${num1}"); 
   num2--; 
   print("Decrement: ${num2}"); 
}

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266106.html

(0)
上一篇 2022年6月7日
下一篇 2022年6月7日

相关推荐

发表回复

登录后才能评论