题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-04-29 02:17:52

[简答题]下列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(__________);

更多"下列Application程序中,指定as为字符串数组类型,先创建一个"的相关试题:

[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串 :abc123edf456gh,执行程序后输出:123456请填空.
#include <stdio.h>
#include <ctype.h>
main( )
char s[80], d[80]; int i,j;
gets(s);
for (i=j=0;s[i]!=’/0’;i++)
if( ) d[j]=s[i]; j++;
d[j]=’/0’;
puts (d);

[填空题]以下程序的功能是将字符串s中的数字字符放人d数组中,最后输出d中的字符串。例如,输入字符串abc123edf456gh,执行程序后输出123456。请填空。
# include<stdio. h>
# include<ctype. h>
main( )
char s[80], d[80]; int i, j;
gets(s);
for(i=j=0; s[i]!=’/0’; i++)
if( 【6】 ) d[j]=s[i]; j++;)
d[j]=’/0’;
puts(D) ;

[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。
例如,输入字符串:abc123edf456gh,执行程序后输出:123456。请填空。
#include <stdio.h>
#include <ctype.h>
main( )
char s[80],d[80]; int i,j;
gets(s);
for(i=j=0;s[i]! =’/0’;i++)
if( 【9】 ) d[j]=s[i]; j++;
d[j]=’/0’;
puts(d);

[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:abc123edf456gh,执行程序后输出:123456。请填空。   #include  <stdio.h>   #include  <ctype.h>   main( )   { char s[80], d[80]; int i,j;    gets(s);    for(i=j=0;s[i]!=’’/0’’;i++)      if(【 】) { d[j]=s[i]; j++; }    d[j]=’’/0’’;    puts(d);   }
[填空题]在给定程序中,函数fun的功能是:求出形参SS所指字符串数组中最长字符串的长度,其余字符串左边用字符*补齐,使其与最长的字符串等长。字符串数组中共有M个字符串,且串长<N。
请在程序的下画线处填入正确的内容并把下画线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。不得增行或删行,也不得更改程序的结构。
文件BLANK1.C内容如下:
#include<stdio.h>
#include<string.h>
#define M 5
#define N 20
void fun(char( *ss)[N])
int i,j,k=0,n,m,len;
for(i=0;i<M;i++)
len=strlen(ss[i]);
if(i==0)n=len:
if(len>n)
/**********found**********/
n=len;
(1) =i;


for(i=0;i<M;i++)
if(i!=k)
m=n:
len=strlen(ss[i]);
/***********found***********/
for(j= (2) ;j>=0;j--)ss[i][m--]=ss[i][j];
for(j=0;j<n-len;j++)
/**********found**********/
(3) =’*’:

void main( )
char ss[M][N]="shanghai","guangzhou","beijing","tianjing","cchongqing";
int i;
printf("/nThe original strings are: /n");
for(i=0;i<M;i++)printf("%s/n",ss[i]);
printf("/n");
fun(ss);
printf("/nThe resuh
[填空题]以下程序的功能是将宁符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:abcl23edf4568h,执行程序后输出:123456。请填空。
#include <stdio.h>
#include <ctype.h>
main( )
char s[80],d[80]; int i,j;
gets(s);
for(i=j=0;s[i]!=’/0’;i++)
if( 【20】 ) d[j]=s[i];j++;
d[j]=’/0’;
puts(d);

[单项选择]不能把字符串Hello!赋给数组b的语句是( )。
[填空题]设某个程序中要用到一个二维数组,要求数组名为A,类型为字符串类型,第一维下标从1到5,第二维下标从-2到6,则相应的数组声明语句为 【9】

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码