题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-06 05:51:10

[填空题]MagBox函数除了在对话框中显示提示信息外,另一个功能是工______。

更多"MagBox函数除了在对话框中显示提示信息外,另一个功能是工_____"的相关试题:

[填空题]MagBox函数除了在对话框中显示提示信息外,另一个功能是工______。
[单项选择]一个函数为void(int,char=’a’),另一个函数为void f(int),则它们( )。
A. 不能在同一程序中定义
B. 可以在同一程序中定义并可重载
C. 可以在同一程序中定义,但不可以重载
D. 以上说法均不正确
[简答题]编写一个函数find Str( ),该函数统计一个长度为2的字符串在另一个字符串中出现的次数。例如,假定输入的字符串为"asd asasdfg asd as zx67 asd mklo",子字符串为“as”,函数返回值是6。
函数ReadWrite( )的功能是实现从文件in40.dat中读取两个字符串,并调用函数findStr( ),最后把结果输出到文件out40.dat中。
注意:部分源程序已给出。
请勿改动主函数main( )和其他函数中的任何内容,仅在函数findStr( )的花括号中填入你所编写的若干语句。
试题程序:
#include<stdio.h>
#include<string.h>
#include<conio.h>
int findStr(char *str,char *substr)




main( )

char str[81],substr[3];
int n;
clrscr( );
printf ("输入原字符串:");
gets(str);
printf("输入子字符串:");
gets(substr);
puts(str);
puts(substr);
n=findstr(str,substr);
printf("n=%d/n",n);
ReadWrite( );

ReadWrite( )

char ch,str[81],substr[3];
int n, len, i=0;
FILE *rf,*wf;
rf=fopen ("in40.dat","r");
wf=fopen ("out40.dar","w");
while (i<5)

fgets(str,80,rf);
fgets(substr,10,rf);
le
[简答题]编写一个函数findStr( ),该函数统计一个长度为2的字符串在另一个字符串中出现的次数。例如,假定输入的字符串为"asd asasdfg asd as zx67 asd mklo",子字符串为"as",函数返回值是6。
函数ReadWrite( )的功能是实现从文件in68.dat中读取两个字符串,并调用函数findStr( ),最后把结果输出到文件out68.dat中。
注意:部分源程序已给出。
请勿改动主函数main( )和其他函数中的任何内容,仅在函数findStr( )的花括号中填入你所编写的若干语句。
[试题程序]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void ReadWrite( );
int findStr(char * str,char * substr)


void main( )

char str[81],substr[3];
int n;
system("CLS");
printf("输入原字符串:");
gets(str);
printf("输入子字符串:");
gets(substr);
puts(str);
puts(substr);
n=findStr(str,substr);
printf("n=% d/n",n);
ReadWrite( );

void meadWrite( )

char ch,str[81],substr[3];
int n,len,i=0;
FILE * rf, * wf;
rf=fopen("in68.dat","r");
wf=fopen("out68.dat","w");
while(i<5)

fgets(str,80,rf);
fgets(substr,10,r
[简答题]编写一个函数,该函数可以统计一个长度为2的字符串在另一个字符串中出现的次数。例如,假定输入的字符串为asd asasdfg asd as zx67 asd mklo,子字符串为as,则应当输出6。
注意:部分源程序给出如下。
请勿改动主函数main和具他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
#include <conio.h>
#include <stdio.h>
#include <string.h>
int fun(char *str, char *substr)


main ( )

char str[81],substr[3];
int n;
clrscr ( );
printf ("输入主字符串 ");
gets (str);
printf ("输入子字符串");
gets (substr);
puts (str);
puts (substr);
n=fun (shr, substr);
printf("n=%d/n ",n);

[简答题]编写一个函数,用该函数可以统计一个长度为3的字符串在另一个字符串中出现的次数。例如,假定输入字符串“the abcthe they have theren”,子字符串为“the”,则应输出4。
注意:部分源程序在文件PROC2.CPP中。
请勿改动主函数和其他函数中的任何内容,仅在fun( )的花括号中填入编写的若干语句。
部分源程序如下:
//PROC2.CPP
#include <iostream>
using namespace std;
#define MAX 100
int fun(char *str,char *substr);
int main( )
char str[MAX],substr[3];
int n;
cout<<"Please Input the source String/n";
cin>>str;
cout<<"Please Input the subString/n";
cin>>substr;
n=fun(str, substr);
cout<<"The counter is: "<<n<<end1;
return 0;

int fun(char *str,char *substr)

//******

[填空题]友元类的所有成员函数都是另一个类的______函数。
[填空题]友元类的所有成员函数都是另一个类的 【8】 函数。
[简答题]有一个字符串,包含n个字符。写一个函数,将此字符串中从第m个字符开始的全部字符复制成为另一个字符串。要求在主函数中输入字符串及m值并输出复制结果。

我来回答:

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

订单号:

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