网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
【判断题】数据类型Char(n)和varchar(n)中的n的意义是一样的
A.Y.是
B.N.否
参考答案和解析
D
更多 “【判断题】数据类型Char(n)和varchar(n)中的n的意义是一样的A.Y.是B.N.否” 相关考题
考题
假定一个函数的二维数组参数说明为char w[][N],与之等价的指针参数说明为()。
A. char (*w)[N]B. char *w[N]C. char (*w)ND. char**a
考题
有以下程序include stdio.hint fun(char s[]){ int n=0;while(*s='9'stdio.hint fun(char s[]){ int n=0;while(*s='9'*s='0') {n=10*n+*s-'0';s++;}return(n);}main(){ char s[10]={ '6', '1', '*', '4', '*', '9', '*', '0', '*'};printf("%d\n",fun(s));}程序运行的结果是A ) 9B ) 61490C ) 61D ) 5
考题
以下结构体类型说明和变量定义中正确的是A)typedef struct{int n; char c;} REC;REC t1,t2;B)struct REC;{int n; char c;};REC t1,t2;C)typedef struct REC ;{int n=0; char c='A';} t1,t2D)struct{int n;char c;}REC;REC t1,t2;
考题
以下程序中函数 fun 的功能是:统计 person 所指结构体数组中所有性别 (sex) 为 M 的记录的个数 , 存入变量 n 中,并做为函数值返回。请填空:#include stdio.h#define N 3typedef struct{ int num;char nam[10]; char sex;} SS;int fun(SS person[]){ int i,n=0;for(i=0;iN;i++)if( 【 14 】 =='M') n++;return n;}main(){ SS W[N]={{1, "AA", 'F'},{2, "BB",'M'},{3,"CC", 'M'}}; int n;n=fun(W); printf("n=%d\n",n);}
考题
请编写函数proc,该函数的功能是:将放在字符串数组中的M个字符串(每串的长度不超过N),按顺序合并组成一个新的字符串。 例如,若字符串数组中的M个字符串为: ABCD BCDEFG CDEFGHI 则合并后的字符串内容应该是ABCDBCDEFGCDEF—GHl。 注意:部分源程序给出如下。 请勿改动main函数和其他函数中的任何内容,仅在函数proc的花括号中填人所编写的若干语句。 试题程序: includestdio.h includeconio.h define M 3 define N 20 void proc(char arr[M][N],char*b) {} void main { char str[M][N]={"ABCD","BCDEFG"," CDEFGHI"},i; char arr[100]={" "); printf("The string:\n"); for(i=0;iM;i++) puts(str[i]); printf("\n"); proc(str,arr); printf("The A string:\n"); printf("%s",arr); printf("\n\n"); }
考题
SQLServer的字符型数据类型主要包括()。
A、Int、money、charB、char、varchar、textC、datetime、binary、intD、char、varchar、int
考题
请补充函数fun(),该函数的功能是:返回字符数组中指定子符的个数,指定字符从键盘输入。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include <stdio.h>define N 80int fun (char s[],char ch){int i=0, n=0;while(【 】){if(【 】)n++;i++;}【 】;}main ( ){int n;char str[N], ch;clrscr ();printf ("\nInput a string: \n");gets (str);printf ("\nInput a charactor: \n" ;scanf ("%c", ch);n=fun (str, ch);printf("\nnumber of %c:%d", ch, n);}
考题
str为一个字符序列。请补充函数fun(),该函数的功能是:查找str中值为x的元素,返回该字符序列中值为x的元素个数,并把这些值为x的元素下标依次保存在数组bb中。例如,在“abcdefahij”中查找‘a’,结果为:2个‘a’,下标依次为 0、6。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include<stdio.h>include<conio.h>define N 20int bb[N];int fun(char *str,char ch){int i=0, n=0;char t=ch;char *p=str;while(*p){if (【 】)【 】;p++;i++;}return【 】;}main(){char str[N];char ch;int i, j,n;clrscr();printf("***Input the original string***\n");gets(str);printf("***The Original ***\n");puts(str);printf("***Input character ***\n");scanf("%c",ch);n=fun(str,ch);printf("\nThe numbr of character is:%d\n", n);printf{"***The suffix of character***\n");for(i=0;i<n;i++)printf("%d ",bb[i]);}
考题
请编写一个函数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 func(char**m) {++m:cout
以下程序的输出结果是( )。 #include<iostream.h> void func(char**m) { ++m: cout<<*m<<endl; } void main() { static char*a[]={"MORNING","AFTERTOON","EVENING"}; char**n; n=a: func(n); }A.为空B.MORNINGC.AFTERTOOND.EVENING
考题
执行下列程序段,结果是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
考题
以下函数fun的功能是返回str所指字符串中以形参c中字符开头的后续字符串的首地址,例如,str所指字符串为Hello!,c中的字符为e,则函数返回字符串ello!的首地址。若str所指字符串为空或不包含c中的字符,则函数返回NULL,请填空。char *fun(char *str,char c){ int n=0; char *p=str; if(p!=NULL) while(p[n]!=cp[n]!=’\0’) n++; if(p[n]==’\0’) return NULL; return();}
考题
下列程序中函数fun的功能是:统计person所指结构体数组中所有性别(sex)为M的记录的个数,存入变量n中,并作为函数值返回。请填空。include <stdio.h>define N 3typedef struct{ int num; char nam[10]; char sex;} SS;int fun(SS person[]){ int i,n=0;for(i=0; i<N; i++)if(【 】=='M') n++;return n;}main(){ SS W[N]={{1,"AA",'F'},{2,"BB",'M'},{3,"CC",'M'}}; int n;n=fun(W); printf("n=%d\n", n);}
考题
有以下程序include using namespace std:class Base{private:char c;public:Base(cha
有以下程序#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
考题
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‘)) );
考题
将小写字母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
考题
试题3本程序中,函数fun的功能是判断字符串是否是回文,若是回文,则返回1,主函数中输出YES;否则,函数返回0,主函数中输出NO。回文是指顺读和倒读都一样的字符串。例如,字符串LEVEL是回文,而123312就不是回文。请在函数fun的花括号中填入你编写的若干语句。(注意:不改动程序的结构,不得增行或删行。)#include stdio.h#define N 80int fun ( char *str){}main(){ char s[N];printf(“Enter a string : ”) ;gets (s) ;printf(“\n\n”) ;puts (s) ;if (fun (s))printf (“YES\n”) ;elseprintf (“N0\n”) ;nono ();}nono (){/*请在此函数内打开文件,输入测试数据,调用fun函数,输出数据,关闭文件.*/int i;FILE *rf, *wf ;char s[N] ;rf = fopen (“bc.in”,“r”) ;wf = fopen (“bc.out”,“w”) ;for ( i=0; i10; i++ ){ fscanf (rf, “%s”,s ) ;if (fun ( s ))fprintf (wf, “%s YES\n”, s ) ;Elsefprintf(wf, “%s NO\n”, s ) ;}fclose (rf) ;fclose (wf) ;}
考题
ORACLE中char类型与varchar2类型的区别,描述正确的是()A、char为定长字符数据类型B、char为不定长字符数据类型C、varchar2为不定长数据类型D、char与varchar2没有区别E、varchar2为定长数据类型
考题
SQLServer的字符型系统数据类型主要包括()。A、Int、money、charB、char、varchar、textC、datetime、binary、intD、char、varchar、int
考题
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')) );
考题
问答题请写出数据类型(int char varchar datetime text)的意思;请问varchar和char有什么区别
热门标签
最新试卷