Let s say I have this piece of C/C++ code:
int c = 12; // Should I count this line as basic block?
if (a != 0 && b > 10) {
c += (a + b);
} else {
c += 1;
}
printf("%d", c); // Should I count this line as basic block?
试题a = 1, b = 12
?
是75%还是50%?
我是否应该把第1行和最后一行作为基本内容?
另一个混淆点:
int c = 16;
d += c;
它是基本组成部分还是2个基本组成部分? 是否应当把每一条线都算作一个基本组成部分?