下列关于栈的叙述中,正确的是
- A.栈底元素一定是最后入栈的元素
- B.栈顶元素一定是最先入栈的元素
- C.栈操作遵循先进后出的原则
- D.以上说法均错误
热度🔥167
解析:打开微信小程序查看本题解析
有以下程序
#include
main()
{ int i, s=0, t[]={1,2,3,4,5,6,7,8,9};
for(i=0;i<9;i+=2) s+=*(t+i);
printf("%d\n",s);
}
程序执行后的输出结果是
有以下程序
#include
main()
{ FILE *fp;
int i, a[6]={1,2,3,4,5,6},k;
fp = fopen("data.dat", "w+");
fprintf(fp, "%d\n", a[0]);
for (i=1; i<6; i++)
{ fseek(fp, 0L, 0);
fscanf(fp, "%d", &k);
fseek(fp, 0L, 0);
fprintf(fp, "%d\n", a[i]+k);
}
rewind(fp);
fscanf(fp, "%d", &k);
fclose(fp);
printf("%d\n", k);
}
程序的运行结果是
在SQL Server 2008中,设有职工表(职工号,姓名,所在部门,工资),现要建立查询指定部门的最高工资的标量函数。下列语句中正确的是()。