更多"CRT显示器每一屏幕中可以显示的字符数是 【19】 。"的相关试题:
[填空题]CRT显示器每一屏幕中可以显示的字符数是 【19】 。
[填空题]请补充main函数,改函数的功能是,把一个二维字符数组每行字符串最大的字符拷贝到字符数组s中。
例如,如果str[3]={"efjh","cfimls","owys"},则s;"hsy"。
注意:部分源程序给出如下.
请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。
试题程序:
#inc lude<stdio, h>
main( )
{
int i=0;
char *str [3] ={ "efjh", "efknls",
"owys" };
char **p;
char s [8];
clrscr 0;
【1】;
for (i=O; i<3; i++)
{
s [i] =*p [i];
while (*p [i] )
{
if (S [i] <*p [i] )
s [i] =*p[i];
【2】;
}
}
【3】;
printf(" new string /n");
puts (s);
}
[填空题]请补充main函数,改函数的功能是,把一个二维字符数组每行字符串最大的字符拷贝到字符数组s中。
例如,如果str[3]="efjh","cfimls","owys",则s;"hsy"。
注意:部分源程序给出如下.
请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。
试题程序:
#inc lude<stdio, h>
main( )
int i=0;
char *str [3] = "efjh", "efknls",
"owys" ;
char **p;
char s [8];
clrscr 0;
【1】;
for (i=O; i<3; i++)
s [i] =*p [i];
while (*p [i] )
if (S [i] <*p [i] )
s [i] =*p[i];
【2】;
【3】;
printf(" new string /n");
puts (s);
[填空题]请补充main( )函数,该函数的功能是:把一个二维字符数组每行字符串中最大的字符复制到字符数组s中。
例如,如果arr[3]="hoih", "yufui", "xgf",则str="oyx"。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容。
试题程序:
#include<stdlib.h>
#include<stdio.h>
void main( )
int i=0;
char *arr[3]="hoih", "yufui", "xgf";
char **p;
char str[8];
system("CLS");
(1) ;
for(i=0; i<3; i++)
str[i]= *p[i];
while(* p[i])
if (str[i]<*p[i])
str[i]=*p[i];
(2) ;
(3) ;
printf("new string/n");
puts(str);
[填空题]输入5个字符,从中找出最大的并输出。要求用字符数组存放此字符,并用指针数组元素分别指向这5个字符。
#include<stdio.h>
main( )
{char a[5],*p[5],*max;
int I;
for(I=0;I<5;I++)
______;/*第一空*/
for(I=0;I<5;I++)
scanf("%C",p[I]);
max=p[0];
for(I=0;______;I++)/*第二空*/
if(*max<*p[I])
______;/*第三空*/
printf("%c",*max);
}
[填空题]下面程序是把从终端读入的20个字符作为字符串放在字符数组中,然后利用指针变量输出上述字符串,请填空。
#include<stdio.h>
main( )
int i;char s[21],*p;
for(i=0;i<20;i++)
s[i]=getchar( );
s[i]= 【12】 ;
p= 【13】 ;
while(*p) putchar( 【14】 );
[填空题]请补充函数proc( ),该函数的功能是:删除字符数组中小于指定字符的字符,指定字符从键盘输入,结果仍保存在原数组中。
例如,输入“abcdefghij”,指定字符为“f”,则结果输出“fghij”。
注意:部分源程序已给出。
请勿改动主函数main和其他甬数中的任何内容。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#define M 80
void proc(char str[], char ch)
int i=0, j=0;
while(str[i])
if(str[i]<ch)
(1) ;
else
(2) ;
i++;
(3) ;
void main( )
char str[N], ch;
system("CLS");
printf("/n Input a string: /n");
gets(str);
printf("/n***original string***/n");
puts(str);
printf("n Input a charactor:/n");
scanf("%c", &ch);
proc(str, oh);
printf("/n***new string***/n");
puts(str);
[填空题]请补充函数fun( ),该函数的功能是;删除字符数组中小于等于指定字符的字符,指定字符从键盘输入,结果仍保存
例如,输入“abcdefghij”,指定字符为‘d’,则结果输出“defghij”。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun( )的横线上填入所编写的若干表达式或语句。
试题程序:
#include <stdio. h>
#define N 80
void fun (char s[], char ch)
int i=0, j=0;
while (s [i] )
if (s Iii<ch)
【1】 ;
else
【2】
i++;
【3】
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);
[填空题]从键盘输入一组小写字母,保存在字符数组str中。请补充函数fun( ),该函数的功能是:把字符数组str中字符下标为奇数的小写字母转换成对应的大写字母,结果仍保存在原数组中。
例如,输入“acegikm”,输出“aCeGiKm”。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun( )的横线上填入所编写的若干表达式或语句。
试题程序:
#include <stdio.h>
#define N 80
void fun (char s[])
int i=0;
while ( 【1】 )
if (i%2!=0)
s[i]-= 【2】 ;
【3】 ;
main ( )
char str [N];
clrscr ( );
printf("/n Input a string:/n");
gets (str);
printf("/n*** original string ***/n");
puts (str);
fun (str);
printf ("In*** new string ***/n");
puts (str);
[填空题]从键盘输入一组小写字母,并保存在字符数组str中。请补充函数fun( ),该函数的功能是:把字符数组str中ASCII码为奇数的小写字母转换成对应的大写字母,结果仍保存在原数组中。
例如,输入“abcdefg”,输出“AbCdEfG”。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun( )的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#define N 80
void fun(char s[])
{
int i;
for( 【1】 ; 【2】 ;i++)
{
if( 【3】 )
s[i]-=32;
}
}
main( )
{
char str[N];
clrscr( );
printf("/n lnput a string:/n");
gets(str);
printf("/n*** original string ***/n");
puts (str);
fun (str);
printf("/n*** new string ***/n");
puts (str);
}
[填空题]顺序串是用一组地址连续的存储单元来存储串中的字符序列,所以可以用字符数组来实现,按照存储分配方式的不同可以将顺序串分为两类:即______和______。