⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soln2_3.cpp

📁 Wrox.Ivor.Hortons.Beginning.Visual.C.Plus.Plus.2008 With sourcecode
💻 CPP
字号:
// Soln2_3.cpp

/*
  1 + 2 + 3 + 4 is executed as:

  (((1 + 2) + 3) + 4)

  because addition is left-associative.
*/

/*
  16 * 4 / 2 * 3 is executed as:

  (((16 * 4) / 2) * 3)

  because multiply and divide are left asociative and of equal precedence. 
  The result will be 96
  If you want the numerator to be 16*4 and the denominator to be 2*3 you write
  the expression as:

  (16 * 4)/(2 * 3)

  The result of this expression will be 10.

*/

/*
  a > b ? a : c > d ? e : f is executed as:

  a > b ? a : (c > d ? e : f)

  because the conditional operator ?: is right_associative>
*/

/*
  a & b && c & d is executed as:

  (a & b) && (c & d)

  because the & operator is of higher precedence than the && operator
  so & operation are executed first.

*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -