单项选择题
有两个关系R和S如下:
R
A
B
C
a
1
2
b
2
1
c
3
1
S
A
B
C
c
3
1
则由关系R得到关系S的操作是______。
A.自然连接
B.并
C.选择
D.投影
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
问答题
请编写函数proc(),其功能是:将str所指字符串中除下标为偶数、同时ASCII码值为奇数的字符外,其余的字符都删除,串中剩余字符所形成的一个新串放在t所指的数组中。例如,若str所指字符串中的内容为ABCDEFG12345,其中字符B的ASCII码值为偶数,所在元素的下标为奇数,因此必须删除;而字符A的ASCII码值为奇数,所在数组中的下标为偶数,因此不应当删除。依此类推,最后t所指的数组中的内容应是ACEG。注意:部分源程序给出如下。请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的花括号中填入所写的若干语句。试题程序:#include<stdlib.h>#include<conio.h>#include<stdio.h>#include<string.h>void proc(char*str, char t[]){}void main(){char str[100], t[100];system( CLS ); printf( nPlease enter string str: ); scanf( %s , str); proc(str, t); printf( nThe result is: %s n , t);
点击查看答案
问答题
下列给定程序中函数proc的功能是:取出长整型变量s中偶数位上的数,依次构成一个新数放在t中。例如,当s中的数为123456789时,t中的数为2468。请修改程序中的错误,使它能得出正确的结果。注意:不要改动main()函数,不得增行或删行,也不得更改程序的结构。试题程序:#include<stdlib.h>#include<stdio.h>#include<conio.h> ****found****void proc(long s, long t){long s1=10;s =10;*t=s%10; ****found****while(s<0){ s=s 100;*t=s%10*s1+*t;s1=s1*10;}}void main(){long s, t;system( CLS );printf( nPlease enter s: );scanf( %ld , &s); proc(s, &t); printf( The result is:%ld n , t); }
点击查看答案
相关试题
若以下选项中的变量全部为整型变量,且已正...
有以下程序:#include <stdio.h>main...
有以下程序:#include<stdio.h>int f...