更多"字符串类型的变量一般用()和字符数组类型的变量表示。"的相关试题:
[填空题]字符变量以char类型表示,它在内存中占 【8】 bit。
[填空题]下面程序是把从终端读入的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】 );
[填空题]字符变量以char类型表示,它在内存中占 【7】 位bit.
[填空题]在Java中定义一个字符串类型的变量str的语句是:______,定义一个具有10个元素的整型数组a的语句是:______。
[填空题]Java中的字符变量以char类型表示,它在内存中占 【6】 位bit。
[填空题]下面的程序是将从终端读入的20个字符放入字符数组中,然后利用指针变量输出上述字符串,请填空。
#include<stdio.h>
main( )
{ int i;
char s[21],*p;
for(i=0;i<20;i++)
s[i]=getehar( );
s[i]= 【6】 ;
p= 【7】 ;
while(*p) putchar( 【8】 );
}
[填空题]下面的程序是将从终端读入的20个字符放入字符数组中,然后利用指针变量输出上述字符串,请填空。
#include<stdio.h>
main( )
int i;
char s[21],*p;
for(i=0;i<20;i++)
s[i]=getehar( );
s[i]= 【6】 ;
p= 【7】 ;
while(*p) putchar( 【8】 );
[填空题]字符变量以_______类型表示,它内存中占16个bit
[填空题]请补充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);
[简答题]下列Application程序中,指定as为字符串数组类型,先创建一个HashSet对象并赋值,然后在屏幕输出s,请将程序补充完整。
import java.util.*;
public class test17_1
public static void main(String[] args)
__________s=new HashSet( );
s.add("Hello");
s.add("World");
s.add(new Character(’我’));
s.add(new Integer(23));
s.add("Hello");
__________as="W","o","r","1","d";
s.add(as);
s.add(null);
s.add(new Integer(23));
s.add(null);
System.out.println(__________);
[填空题]字符串分为两大类,一类是字符串常量,使用String类的对象表示;另一类是字符串变量,使用【 】类的对象表示。