网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
char(n)和varchar(n)的区别是什么?其中n的含义是什么?各占用多少空间?
参考答案
更多 “char(n)和varchar(n)的区别是什么?其中n的含义是什么?各占用多少空间?” 相关考题
考题
假定一个函数的二维数组参数说明为char w[][N],与之等价的指针参数说明为()。
A. char (*w)[N]B. char *w[N]C. char (*w)ND. char**a
考题
●试题一阅读下列函数说明和C代码,把应填入其中n处的字句写在答卷的对应栏内。【函数1.1说明】函数strcpy(char*to,char*from)将字符串from复制到字符串to。【函数1.1】void strcpy(char*to,char*from){while( ( 1 ) );}【函数1.2说明】函数merge(int a[ ],int n,int b[ ],int m,int *c)是将两个从小到大有序数组a和b复制合并出一个有序整数序列c,其中形参n和m分别是数组a和b的元素个数。【函数1.2】void merge(int a[ ],int n,int b[ ],int m,int *c){ int i,j;for(i=j=0;i<n j<m;)*c++=a[i]<b[j]? a[i++]:b[j++];while( (2) )*c++=a[i++];while( (3) )*c++=b[j++];}【函数1.3说明】递归函数sum(int a[ ],int n)的返回值是数组a[ ]的前n个元素之和。【函数1.3】int sum(int a[ ],int n){ if(n>0)return (4) ;else (5) ;}
考题
试题二(共 15 分)阅读以下说明和 C 程序,将应填入 (n) 处的字句写在答题纸的对应栏内。[说明]下面的程序按照以下规则输出给定名词的复数形式:a. 若名词以“y”结尾,则删除 y 并添加“ies” ;b. 若名词以“s” 、 “ch”或“sh”结尾,则添加“es” ;c. 其他所有情况,直接添加“s” 。[C 程序]#include stdio.h#include string.hchar *plural(char *word){int n;char *pstr;n = strlen(word); /*求给定单词的长度*/pstr = (char *)malloc(n+3); /*申请给定单词的复数形式存储空间*/if (!pstr || n 2)return NULL;strcpy(pstr,word); /*复制给定单词*/if ( (1) ){pstr[n-1] = 'i'; pstr[n] = 'e'; pstr[n+1] = 's'; (2) ;}elseif(pstr[n-1]=='s'||pstr[n-1]== 'h' ( (3) )){pstr[n] = 'e'; pstr[n+1] = 's'; pstr[n+2] = '\0';}else{ pstr[n] = 's'; pstr[n+1] = '\0'; }(4) ;}main( ){ int i; char *ps;char wc[9][10] ={"chair","dairy","boss","circus","fly","dog","church","clue","dish"}for(i = 0; i 9; i++) {ps = (5) ;printf("%s: %s\n",wc[i],ps); /*输出单词及其复数形式*/free(ps); /*释放空间*/}system("pause");}
考题
有以下程序: include using namespace std; constxntN=5; int fun(char*s,char a,int
有以下程序:include <iostream>using namespace std;const xnt N=5;int fun(char *s,char a,int n){int j;*s=a;j=n;while(a<s[j])j--;return j;}int main(){char s[N+1];int k;
考题
请编写一个函数char *fun(char *s,int n)。函数fun()的功能是将字符串s中的字符“循环左移”n位。例如,输入“ABCDE”,则循环左移2位应输出“CDEAB”,输入“1234567”,循环左移3位应输出“4567123”。注意:部分源程序已存在文件PROC13.cpp中。请勿修改主函数和其他函数中的任何内容,仅在函数fun()的花括号中填写若干语句。文件PROC13.cpp的内容如下://PROC13.cppinclude <iostream>include <string>using namespace std;char *fun(char *s,int n);int main(){char str[81];int n;cout<<"Enter a string(less than 80 char)\n”;cin>>str;cout<<"\n Enter n:";cin>>n;if(n>strlen(str)){cout<<"\n Data overflow";return 0;}cout<<"The result is: "<<fun(str,n)<<end1;return 0;}char *fun(char*s,int n){//* * * * * *}
考题
执行下列程序段,结果是includevoid main( ){int x=40; char y='C'; int n;?n=(x char y='C'; int n; ? n=(x0) xff) (y>'B') ; cout < < n;}A.0B.1C.2D.3
考题
PAL彩色电视制式播放1分钟未压缩的视频图像占用的存储空间是(14)(设每帧图像存储占用的空间为N kb)。A.N×1000×60×25BB.N×1000×60×30BC.N×60×30KBD.N×60×25B
考题
char str[ ]= "Hello";char *p=str;int n=10;sizeof(str)=( )sizeof(p)=( )sizeof(n)=( )void func(char str[100]){ }sizeof(str)=( )
考题
Given the following requirements:Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values ‘C‘, ‘H‘ and ‘N‘, and permits inserts only when a corresponding value for the employee‘s department exists in the DEPARTMENT table.Which of the following CREATE statements will successfully create this table?()A.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN (‘C‘,‘H‘,‘N‘)), );B.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES (‘C‘,‘H‘,‘N‘) );C.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN (‘C‘,‘H‘,‘N‘)), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );D.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN (‘C‘,‘H‘,‘N‘)) );
考题
有如下程序: #include 〈iostream〉 using namespace std; class Base { private: char c; public: Base(char n) :c(n) {} ~Base ( ) { cout〈〈c; } }; class Derived : public Base { private: char c; public: Derived(char n) :Base(n+1),c(n) { } ~Derived () { cout〈〈c; } }; int main ( ) { Derived obj ('x'); return 0; } 执行上面的程序将输出( )。A.xyB.yxC.xD.y
考题
将小写字母n赋值给字符变量one_char,正确的操作是 ______。A.one_char='n'B.one_char="n"C.one_char=110D.one_char='N'
考题
有以下程序includeusing namespace std;class Base{private:char c;public:Base(char
有以下程序 #include<iostream> using namespace std; class Base { private: char c; public: Base(char n):c(n){} ~Base() { cout<<c; } }; class Derived:public Base { private: char c; public: Derived(char n):Base(n+1),c(n){} ~Derived() { cout<<c; } }; int main() { Derived obj('x'); return 0; } 执行后的输出结果是A.xyB.yxC.xD.y
考题
阅读以下说明和C程序,将应填入 (n) 处的字句写在对应栏内。 2、【说明】下面的程序按照以下规则输出给定名词的复数形式。 a.若名词以“y”结尾,则删除y并添加“ies”; b.若名词以“s”、“ch”或“sh”结尾,则添加“es”; c.其他所有情况,直接添加“s”。【C程序】 #include <stdio.h> #include <string.h> char*plural(char *word) { int n; char *pstr; n=strlen(word); /*求给定单词的长度*/ pstr=(char*)malloc(n+3);/*申请给定单词的复数形式存储空间*/ if (!pstr||n<2) return NULL; strcpy(pstr,word); /*复制给定单词*/ if ( (1) ) { pstr[n-1]='i';pstr[n] ='e';pstr[n+1]='s'; (2) ; } else if(pstr[n-1]=='s'| |pstr[n-1]=='h'&&( (3) )) { pstr[n]='e';pstr[n+1]='s';pstr[n+2]='\0'; } else { pstr[n]='s';pstr[n+1]='\0';) (4) ; } main() { int i; char *ps; char wc[9][10]= {"chair","dairy","boss","circus","fly","dog","church","clue","dish"); for(i = 0;i<9; i++) { ps= (5) ; printf("%s: %s\n",wc[i],ps); /*输出单词及其复数形式*/ free(ps); /*释放空间*/ } system("pause"); }
考题
二分液的组分各是什么()A、Ur:64.5%;C://0.44%;N:0.7%;H:31.4%B、Ur:65.5%;C://0.44%;N:0.7%;H:31.4%C、Ur:67.5%;C://0.44%;N:0.7%;H:31.4%D、Ur:66.5%;C://0.44%;N:0.7%;H:31.4%
考题
Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()A、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );B、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );C、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );D、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );
考题
问答题肿瘤TNM分期是“T/N/M”各表示的含义是什么?
热门标签
最新试卷