题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-03 07:57:39

[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:
abcl23edf456gh,执行程序后输出: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中的字符"的相关试题:

[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:abcl23edf456gh,执行程序后输出:123456。请填空。
#include <stdioo.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);
[填空题]以下程序的功能是将字符串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( 【9】 ) d[j]=s[i]; j++;
d[j]=’/0’;
puts(d);

[填空题]以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:abc123edf456gh,执行程序后输出:123456。请填空。
#include
#include
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);
}

[填空题]以下程序的功能是将字符串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中的字符串。例如,输入字符串: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);

[填空题]以下程序的功能是从键盘上输入一行字符,存入一个字符数组中,然后输出该字符串。请填空。
main( )
char str[81],*sptr;
int i;
for(i=0;i<80;i++)
str[i]=getchar( );
if(str[i]==’/n’)break;

str[i]= 【10】
sptr=str1
while(* sptr)putchar(* sptr 【11】 );

[填空题]以下程序的功能是从键盘上输入若干个字符(以回车键作为结束)组成一个字符串存入一个字符数组,然后输出该字符数组中的字符串。
main( )
char str[51],*sptr;
int i;
for(i=0;i<50;i++)
str[i]=getchar( );if(str [j]==’/n’)______;
str[i]:______;
sptr=str;
while(*sptr)putchar(*sptr______);

[填空题]以下程序从终端输入一行字符放在s数组中,输入以回车符作为结束,函数fun统计存放在s数组中每个数字字符的个数。形参ch指向s数组,形参n给出了s数组中字符的个数。在acc数组中用下标为0的元素统计字符“0”的个数,下标为1的元素统计字符“1”的个数,…。请填空。
#include <stdio.h>
void fun(int *,char*,int);
main( )
char s[80],c; int acc[10],i=0;
printf("Enter characters:/n");
while((c=getchar( ))!=’/n’)s[ 【11】 ]=c;
fun( 【12】 );
for(i=0;i<10;i++)printf("%c:%d/n",’0’+i,acc[i]);
printf("/n/n");

void fun(int *a,char *ch,int n)
int i,d;
for(i=0;i<10;i++)a[i]= 【13】
for(i=0;i<n;i++)
d= 【14】 ; a[d]++;

[填空题]

以下程序中函数void strol(char xx[])的功能是:将双指向的字符数组内的字符串中所有单词倒排 (即:第一个单词与最后一个单词交换,第二个单词与倒数第二个单词交换,其他单词依次类推。单词之间用空格或标点符号分隔).倒排后的单词之间用空格分隔;最后把已处理的字符串仍存储在xx指向的数组中。例如,若数组中原字符串为"I am a student".则输出应为"student a am I"。
#include
#include
#include
void strol(char xx[])
{
int i,j,k,n=0;
char t[80];
j=strlen(xx)-1;
t[0]=’/0’;
while(j>0)
{while(isalpha(xx[j])==0&&j>=0)j--;
k= ___(23)___;
while(isalpha(xx[j])&&j>=0)j--;
for(i=j+1;i<=k;i++)
t[n++]=___(24)___;
t[n++]=’ ’;
}
t[n]=’/0’;
strcpy(xx,___(25)___);
}
void main( )
{char s[80]="I am a student....";
strol(___(26)___);
puts(s);
}


[简答题]自定义一个函数,函数的形参为字符数组s1和s2,函数功能是将字符串s1中的所有数字字符取出,存入另一字符数组s2中,使s2成为一个新的字符串,并在函数中将字符串s2输出。

我来回答:

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

订单号:

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