题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-01-07 01:19:44

[填空题]请补充函数proc( ),该函数的功能是:求200(不包括200)以内能被2或5整除,但不能同时被2和5整除的自然数。结果保存在数组bb中,函数proc( )返回数组bb中的元素。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#define M 200
int proc(int bb[])

int i, j;
for( (1) ; i<200; i++)
if((i % 2! =0&&i%5==0)||(i%2==
0&&i%5!=0))
(2) ;
(3) ;

void main( )

int i, n;
int bb[M];
system("CLS");
n=proc(bb);
for(i=0; i<n; i++)

if(i%10==0)
printf("n");
printf("%4d", bb[i]);



更多"请补充函数proc( ),该函数的功能是:求200(不包括200)以内"的相关试题:

[填空题]请补充函数proc( ),该函数的功能是:求200(不包括200)以内能被2或5整除,但不能同时被2和5整除的自然数。结果保存在数组bb中,函数proc( )返回数组bb中的元素。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#define M 200
int proc(int bb[])

int i, j;
for( (1) ; i<200; i++)
if((i % 2! =0&&i%5==0)||(i%2==
0&&i%5!=0))
(2) ;
(3) ;

void main( )

int i, n;
int bb[M];
system("CLS");
n=proc(bb);
for(i=0; i<n; i++)

if(i%10==0)
printf("n");
printf("%4d", bb[i]);



[填空题]请补充函数proc( ),该函数的功能是按条件删除一个字符串指定字符一半的数目,具体要求如下:如果该字符串所包含的指定字符的个数是奇数,则不删除,如果其数目是偶数,则删除原串后半部分的指定字符。其中,str指向原字符串,删除后的字符串存放在b所指的数组中,e中存放指定的字符。例如,当str输入“abcabcabcab”,c=“b”时,b的输出为“abcabcaca”;如果str的输入为“abcabeabca”,则b的输出为“abcabcabca”。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
#define M 80
void proc(char str[], char b[], char c)

int i=0, j=0;
int n=0;
int m=0;
while(str[i]!=’/0’)

if(str[i]==c)
n++;
i++;

(1) ;
if (n%2)

while(str[j]!=’/0’)

b[j]=str[j];
j++;

b[j]=’/0’;

else

while(str[i]!=’/0’)

b[j++]=str[i];
if(str[i]==c)
m++;
if((m>n/2)&&(str[i]==c))
(2) ;
i++;

(3) ;


void main( )

char str[M], b[M];
char c;
system("CLS");
printf("Enter the string: /n");
gets(str);
[填空题]请补充函数proc( ),该函数的功能是把数组arr中的奇数元素按原来的先后顺序放在原数组后面。
例如,原始数组为33 67 42 58 25 76 85 16 41 55,则输出结果为42 58 76 16 33 67 25 85 41 55。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#define M 10
void proc(int arr[])

int i, j=0, k=0;
int bb[M];
for(i=0; i<M; i++)

if( (1) )
bb[k++]=arr[i];
else
arr[j++]=arr[i];

for(i=0; i<k; (2) )
arr[j]=bb[i];

void main( )

int i;
int arr[M]=33, 67, 42, 58。25, 76, 85, 16, 41, 55;
system("CLS");
printf("/n***original list***/n");
for(i=0; i<M; i++)
printf("%4d", arr[i]);
proc(arr);
printf("/n***new list***/n");
for(i=0; i<M; i++)
printf("%4d", arr[i]);


[填空题]请补充函数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);


[填空题]请补充函数proc( ),该函数的功能是将字符串str中的大写字母都改为对应的小写字母,其他字符不变。例如,若输入“How Are You”,则输出“how are you”。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容。
试题程序:
#include<stdio.h>
#include<string.h>
#include<conio.h>
char *proc(char str[])

int i;
for(i=0; str[i]; i++)

if((str[i]>=’A’)&&( (1) )
(2) ;

return( (3) );

void main( )

char str[81];
printf("/nPlease enter a string: ");
gets(str);
printf("/nThe result string is: /n%s",
proc(str));


[填空题]为一个字符序列,序列由字符0和1组成。请补充函数proc( ),该函数的功能是:查找该字符序列中0字符连续出现的最长长度(即0字符的个数),如果有几个0字符串长度相同,只记录最后一个0字符串的相关信息。通过m和返回最长0字符串的长度和最后0字符的下标。例如,如果输入“01000010000”,结果为,字符串最长长度为4,起始和结尾下标依次为2、5。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容。
试题程序:
#iinclude<stdlib.h>
#iinclude<stdio.h>
#iinclude<conio.h>
#define M 80
void proc ( (1) )

int i, j=0;
int bb[M];
char *p=str:
*m=0;
*k=0;
for(i=0; i<M; i++)
bb[i]=0;
i=0;
while(*(p+i))

if(*(p+i)==’0’)

(2)
i++;

else

j++;
i++;

if( (3) )

*m=bb[j];
*k=i-1;



void main( )

char str[M];
int m, k;
system("CLS");
printf("***input the original string***/n");
gets(str);
printf("***The Original string***/n");
puts(str);
proc(str, &m, &k);
printf("/nThe length of ’0’ is: %d/n", m);
printf("***The suffix of character*
[填空题]请补充函数proc( ),函数proc( )的功能是求7的阶乘。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容。
试题程序:
#include<stdio.h>
long proc(int n)

if( (1) )
return(n * proc( (2) );
else if( (3) )
return 1;

void main( )

int k=7;
printf("%d!=%ld/n", k, proc(k));


我来回答:

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

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码