【434】COMP9024 Exercises Revision

目录:


01. Week01

  • 数字通过 #define 来定义,可读性更高,另外就是修改方便
    不要忘记 return EXIT_SUCCESS; or return 0;
    fiveDigit.c
  • 计算矩阵內积的时候,其实看上去蛮复杂的
    方法:将计算过程写出来,自己找到规律,找到遍历的逻辑
    innerProdFun.c
    matrixProdFun.c
  • 可以通过表达式来实现 if 语句
     int fastMax(int a, int b, int c) {
        int d = a * (a >= b) + b * (a < b);   // d is max of a and b
        return  c * (c >= d) + d * (c < d);   // return max of c and d
     }
    

    fastMax

02. Week02

猜你喜欢

转载自www.cnblogs.com/alex-bn-lee/p/11394827.html
今日推荐