A类
1. (原创)执行下列代码,程序出错。引发错误的代码行为:
#include <stdio.h>
int main() {
char a[] = "abc";
char *b = "abc";
a[1] = 'B';
b[1] = 'B';
return 0;
}
A. 3 B. 4 C. 5 D. 6
B类
2.(原创)以下程序的运行结果为:
#include <stdio.h>
int main() {
char *s;
int y = 1 / 2;
s = "gh v587";
while (*s++) {
y++;
}
printf("%d\n", y);
return 0;
}
3.(卷3题14搬运)请用C语言表达式表达代数式
(已include<math.h>,e是常量)
----------------------以下为答案-------------------------
1. D
2. 7
3. sqrt(fabs(pow(n,x)+pow(x,e)))