Dart编程实例 - 赋值操作符

本文为大家分享 Dart编程实例 - 赋值操作符 的具体示例代码,提供大家参考,具体内容如下:

void main() {
   var a = 12;
   var b = 3;

   a+=b;
   print("a+=b : ${a}");

   a = 12; b = 13;
   a-=b;
   print("a-=b : ${a}");

   a = 12; b = 13;
   a*=b;
   print("a*=b' : ${a}");

   a = 12; b = 13;
   a/=b;
   print("a/=b : ${a}");

   a = 12; b = 13;
   a%=b;
   print("a%=b : ${a}");
}

本文为大家分享 Dart编程实例 - 逻辑操作符 的具体示例代码,提供大家参考,具体内容如下:void main() { var a = 10; var b = 12; var res = (a>b) ...