网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
已知char a;使用scanf()函数输入一个字符给变量a,不正确的函数调用是()
A

scanf(“%d”,&a)

B

scanf(“%lf”,&a)

C

scanf(“%c”,&a)

D

scanf(“%u”,&a)


参考答案

参考解析
解析: 暂无解析
更多 “单选题已知char a;使用scanf()函数输入一个字符给变量a,不正确的函数调用是()A scanf(“%d”,a)B scanf(“%lf”,a)C scanf(“%c”,a)D scanf(“%u”,a)” 相关考题
考题 有以下结构体说明、变量定义和赋值语句struct STD{ char name[10];int age;char sex;} s[5],*ps;ps=s[0];则以下 scanf 函数调用语句中错误引用结构体变量成员的是A)scanf("%s",s[0].name);B)scanf("%d",s[0].age);C)scanf("%c",(ps-sex));D)scanf("%d",ps-age);

考题 当用户要求输入的字符串中含有空格时,应使用的输入函数是A)scanf()B)getchar()C)gets()D)getc()

考题 请编写一个函数void fun(cbara [], charb [], int n),其功能是:删除一个字符申中指定下标的字符。其中,a指向原字符串,删除后的字符串存放在b所指的数组中,n中存放指定的下标。例如,输入一个字符串world,然后输入3,则调用该函数后的结果为word。注意:部分源程序给出如下。请勿改动主函数main 和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。试题程序:include <stdio.h>include <conio.h>define LEN 20void fun (char a[], char b [], int n){}main (){char str1 [LEN], str2 [LEN];int n ;clrscr ();printf ("Enter the string : \n") ;gets (str1) ;printf ("Enter the position of the stringdeleted: ");scanf ("%d", n) ;fun (str1, str2, n) ;printf ("The new string is : %s \n",str2) ;}

考题 编写一个函数,该函数可以统计一个长度为2的字符串在另一个字符串中出现的次数。例如,假定输入的字符串为asd asasdfg asd as zx67 asd mklo,子字符串为as,则应当输出6。注意:部分源程序给出如下。请勿改动主函数main和具他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。试题程序:include <conio.h>include <stdio.h>include <string.h>int fun(char *str, char *substr){}main ( ){char str[81],substr[3];int n;clrscr ();printf ("输入主字符串 ");gets (str);printf ("输入子字符串");gets (substr);puts (str);puts (substr);n=fun (shr, substr);printf("n=%d\n ",n);}

考题 请补充main函数,该函数的功能是:从键盘输入一个字符串及一个指定字符,然后把这个字符及其后面的所有字符全部删除。结果仍然保存在原串中。 例如,输入“abcdefg”,指定字符为“d”,则输出“abe”。 注意:部分源程序给出如下。 请勿改动main函数和其他函数中的任何内容,仅在main函数的横线上填入所编写的若干表达式或语句。 试题程序: includestdlib.h includestdio.h define M 80 void main { int i=0; char str[M]; char ch; system("CLS"); printf("\n Input a strin9:\n"); gets(str); printf("\n Input a charator;\n"); scanf("%c",&ch); while(str[i]!=\0) { if(str[i]==ch) 【1】 【2】 ; } str[i]=【3】 ; printf("\n***display string***\n"); puts(str); }

考题 当用户要求输入的字符串中含有空格时,应使用的输入函数是( )。A.scanf()B.getchar()C.gets()D.getc()

考题 C语言中,getchar()函数与scanf()函数的区别在于getchar()只能用于字符的输入,而scanf()可以输入任意类型的数据。此题为判断题(对,错)。

考题 当用户要求输入的字符串中含有空格时,应使用的输入函数是( )。A.scanf B.getchar SXB 当用户要求输入的字符串中含有空格时,应使用的输入函数是( )。A.scanfB.getcharC.getsD.getc

考题 请补充函数fun(),该函数的功能是;删除字符数组中小于等于指定字符的字符,指定字符从键盘输入,结果仍保存例如,输入“abcdefghij”,指定字符为‘d’,则结果输出“defghij”。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include <stdio. h>define N 80void fun (char s[], char ch){int i=0, j=0;while (s [i] ){if (s Iii<ch)【 】;else{【 】i++;}}【 】}main (){char str [N], ch;clrscr ();printf("\n Input a string:\n");gets (str);printf("\n*** original string ***\n");puts (str);printf("\n Input a character:\n");scanf ("%c", ch);fun(str, ch);printf("\n*** new string ***\n");puts (str);}

考题 输入二个 64 位的十进制数,计算相乘之后的乘积已知 strcpy 函数的原型是:char * strcpy(char * strDest,const char * strSrc);1.不调用库函数,实现strcpy 函数。2.解释为什么要返回char *。

考题 已知strcpy 的函数原型:char *strcpy(char*strDest, const char *strSrc)其中strDest 是目的字符串,strSrc 是源字符串。不调用C++/C 的字符串库函数,请编写函数strcpy。

考题 已知String类定义如下:class String{public:String(const char *str = NULL); // 通用构造函数String(const String another); // 拷贝构造函数~ String(); // 析构函数String perater =(const String rhs); // 赋值函数private:char *m_data; // 用于保存字符串};尝试写出类的成员函数实现。

考题 编写 strcpy函数已知 strcpy函数的原型是char *strcpy(char *strDest, const char *strSrc);其中 strDest 是目的字符串,strSrc 是源字符串。(1)不调用 C++/C 的字符串库函数,请编写函数 strcpy(2)strcpy能把 strSrc 的内容复制到 strDest,为什么还要 char * 类型的返回值?

考题 语句Char(*P)说明了( )。A.P是指向函数的指针,该函数返回一个Char型数据B.P是指向Char型数据的指针变量C.P是指向数组的指针变量D.P是一个函数名,该函数的返回值是指向Char型数据的指针

考题 以下scanf函数调用语句中对结构体变量成员的不正确引用是 struct pupil { char name[20]; int age int sex; } pup[5],*p; p=pup;A.scanf("%s",pup[0].name);B.scanf("%d",pup[0].age);C.scanf("%dT",(p->sex));D.scanf("%d",p->age);

考题 以下scanf函数调用语句中对结构体变量成员的不正确引用的是()。  struct node{      char name[20];      int age;      int sex; }student[5],*p;  p=student; A、scanf(“%s”,student[0].name);B、scanf(“%d”,student[0].age);C、scanf(“%d”,(p-sex));D、scanf(“%d”,p-age);

考题 当接收用户输入的含空格的字符串时,应该使用的函数是()。A、scanf()B、gets()C、getchar()D、getc()

考题 如果利用一个scanf函数输入多个字符串,则其分隔符是()A、逗号B、分号C、冒号D、空格

考题 不能用scanf函数输入字符。

考题 printf函数和scanf函数的格式说明都使用()字符开始。

考题 在使用函数scanf输入数据时必须与函数参数指定的输入格式一致。

考题 已知char a;使用scanf()函数输入一个字符给变量a,不正确的函数调用是()A、scanf(“%d”,a)B、scanf(“%lf”,a)C、scanf(“%c”,a)D、scanf(“%u”,a)

考题 用scanf函数向已定义的变量中输入数据时,在变量名前面必须加.

考题 从键盘上输入某字符串时,不可使用的函数是().A、getchar()B、gets()C、scanf()D、fread()

考题 只能向终端输出一个字符的函数是()。A、pringf函数B、putchar函数C、getchar函数D、scanf函数

考题 已知double a;使用scanf()函数输入一个数值给变量a,正确的函数调用是()A、scanf(“%ld”,a)B、scanf(“%lf”,a)C、scanf(“%c”,a)D、scanf(“%u”,a)

考题 单选题已知double a;使用scanf()函数输入一个数值给变量a,正确的函数调用是()A scanf(“%ld”,a)B scanf(“%lf”,a)C scanf(“%c”,a)D scanf(“%u”,a)