若有定义:int a[3] = {1,2,3}, *p, i;p = a;且0<=i<10,则下列选项中,对数组元素引用错误的是()
A.*(a+1)
B.a[p-a]
C.p+i
D.*(&a[i])
A.*(a+1)
B.a[p-a]
C.p+i
D.*(&a[i])
A.int a[3][4]={0};
B.int a[3][4]={{1,2},{1,2,3},{1,2,3,4}};
C.int a[3][]={0,1,2,3,4,5,6,7,8,9,10,11,12};
D.int a[][4]={1,2,3,4,5,6,7,8,9,10,11,12};
A.&a,&*point,point
B.a,point,*&a
C.&*a,&a,*point
D.*&point,*point,&a
A.a+=a-=(a=3)*(b=4)
B.x%5
C.a=a*3=2
D.y=float(i)++
oracle关联查询题目1
数据库中有3 个表 teacher 表,student 表,tea_stu 关系表。
teacher 表 teaID name age
student 表 stuID name age
teacher_student 表 teaID stuID
要求用一条sql 查询出这样的结果
1.显示的字段要有老师name, age 每个老师所带的学生人数
2 只列出老师age 为40 以下学生age 为12 以上的记录
预备知识:
1.sql 语句是对每一条记录依次处理,条件为真则执行动作(select,insert,delete,update)
2.只要是迪卡尔积,就会产生“垃圾”信息,所以,只要迪卡尔积了,我们首先就要想到清除“垃圾”信息
实验准备:
drop table if exists tea_stu;
drop table if exists teacher;
drop table if exists student;
create table teacher(teaID int primary key,name varchar(50),age int);
create table student(stuID int primary key,name varchar(50),age int);
create table tea_stu(teaID int references teacher(teaID),stuID int references student(stuID));
insert into teacher values(1,'zxx',45), (2,'lhm',25) , (3,'wzg',26) , (4,'tg',27);
insert into student values(1,'wy',11), (2,'dh',25) , (3,'ysq',26) , (4,'mxc',27);
insert into tea_stu values(1,1), (1,2), (1,3);
insert into tea_stu values(2,2), (2,3), (2,4);
insert into tea_stu values(3,3), (3,4), (3,1);
insert into tea_stu values(4,4), (4,1), (4,2) , (4,3);
结果:2_3,3_2,4_3
寻找最大数 题目内容: 主函数定义一个长度为5的整型一维数组,编写一个函数实现求此一维数组的最大值。函数 原型:int max(int a[], int n); 功能是返回长度为n的数组a中最大的一个数。 输入格式: 5个整数 输出格式: "The result is %d\n" 输入样例1: 12 6 18 9 4↙ 输出样例1: The_result_is_18 输入样例2: 9 7 -2 3 4↙ 输出样例2: The_result_is_9