题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-22 16:44:29

[多项选择]已知在文件IN13.DAT中存有若干个(个数<200)4位数字的正整数,函数ReadDat( )的功能是读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求:(1)求出该文件中共有多少个正整数totNum;(2)求这些数右移1位后,产生的新数是偶数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz,最后调用函数WriteDat( )把所求的结果输出到文件OUT13.DAT中。
注意:部分源程序已给出
请勿改动主函数main( )、读函数ReadDat( )和写函数WriteDat( )的内容。
试题程序:
#include〈stdio.h>
#include〈conio.h>
#define MAXNUM 200
int xx [MAXNUM];
int totNum = 0; /* 文件IN13.DAT 中共有多少个正整数 */
int totCnt = 0; /* 符合条件的正整的个数 */
double totPjz = 0.0; /* 平均值 */
int ReadDat (void);
void Writedat(void); void CalValue(void)
main ( )

int i;
clrscr ( );
for(i = 0; i〈MAXNUM; i++)
xx[i] = 0;
if (ReadDat ( ))

printf ("数据文件 IN13.DAT 不能打开! /007/n");
return;

CalValue ( );
printf("文件IN1B.DAT 中共有正整数= %d 个/n", totNum);
printf("符合条件的正整数的个数= %d 个/n", totCnt);
printf("平均值=%.21f/n", totPjz)
Writedat ( );
int

更多"已知在文件IN13.DAT中存有若干个(个数 注意:部分源程序已给出"的相关试题:

[简答题]已知在文件IN11.DAT中存有若干个(个数<200)4位数字的正整数,函数ReadDat( )的功能是读取这若干个正整数并存人数组xx中。请编制函数CalValue( ),其功能要求:(1)求出该文件中共有多少个正整数totNum;(2)求这些数右移1位后,产生的新数是偶数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz,最后调用函数WriteDat( )把所求的结果输出到文件OUTII.DAT中。
注意:部分源程序已给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数WfiteDat( )的内容。
[试题程序]
#include<stdio.h>
#include<stdlib.h>
#define MAXNUM 200
int xx[MAXNUM];
int totNum=0;/*文件IN11.DAT中共有多少个正整数*/
int totCnt=0;/*符合条件的正整数的个数*/
double totPjz=0.0;/*平均值*/
int ReadDat(void);
void WriteDat(void);
void CalValue(void)


voidmain( )

int i;
system("CLS");
for(i=0;i<MAXNUM;i++)
xx[i]=0;
if(ReadDat( ))

printf("数据文件IN11.DAT不能打开!/007/n");
return;

CalValue( );
printf("文件IN11.DAT中共有正整数=%d个/n",totNum);
printf("符合条件的正整数的个数=%d个/n",totCnt);
printf("平均值=% .21f/n",totpjz);
WriteDat( );

int ReadDat(void)

FILE*fp;
int i=0;
if
[多项选择]已知在文件in70.dat中存有若干个(个数<200)4位数字的正整数,函数ReadDat( )是读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求是:(1)求出这个文件中共有多少个正整数totNum。 (2)求这些数右移一位后,产生的新数是奇数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz。最后调用函数WriteDat( )把所有结果输出到文件out70.dat中。
注意:部分源程序己给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数WriteDat( )的内容。
试题程序:
#include<stdio. h>
#include<conio. h>
#define MAXNUM 200 iht xx [MAXNUM];
int totNum=0;
int totCnt=0;
double totPjz=0.0;
int ReadDat (void);
void WriteDat(void); void CalValue(void)

void main( )

int i;
clrscr ( );
for ( i=0; i xx[i]=0;
if (ReadDat ( ))

printf ("数据文件IN70.DAT不能打开! /007/n");
return;

CalValue ( );
printf ("文件IN70. DAT中共有正整数=%d个/n", totNum);
printf ("符合条件的正整数的个数=%d个/n", totCnt);
printf ("平均值=%. 21f/n", totPj z);
WriteDat ( ); int ReadDat (void)

FILE *fp;
iht i=0;
[多项选择]已知在文件IN13.DAT中存有若干个(个数<200)4位数字的正整数,函数ReadDat( ) 的功能是读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求:(1)求出该文件中共有多少个正整数totNum;(2)求这些数右移1位后,产生的新数是偶数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz,最后调用函数WriteDat( )把所求的结果输出到文件OUT13.DAT中。 注意:部分源程序已给出。 请勿改动主函数main( )、读函数ReadDat( )和写函数WriteDat( )的内容。 试题程序: #include #include #define MAXNUM 200 int xx[MAXNUM]; int totNum = 0; /* 文件IN13.DAT中共有多少个正整数 */ int totCnt = 0; /* 符合条件的正整数的个数 */ double totPjz = 0.0; /* 平均值 */ int ReadDat(void); void Writedat(void); void CalValue(void) { } main( ) { int i; clrscr( ); for(i = 0; i < MAXNUM; i++) xx[i] = 0; if(ReadDat( )) { printf("数据文件IN13.DAT不能打开!/007/n"); return; } CalValue( ); printf("文件IN13.DAT中共有正整数= %d 个/n", totNum); printf("符合条件的正整数的个数= %d 个/n", totCnt); printf("平均值=%.2lf/n", totPjz); Writedat( ); } int ReadDat(void) { FILE *fp; int i = 0; if((fp = fopen ("IN13.DAT", "r")) == NULL) return 1; while(! feof(fp)) { fscanf(fp, "%d,", &xx[i++]);
[简答题]已知在文件in.dat中存有若干个(个数<200)四位非零整数,函数readdat( )读取这若干个整数并存入数组xx中。请编制函数calvflue( ),其功能要求:①求出该文件中共有多少个正整数totnum;②求这些数右移1~6位,产生的一系列新数中含至少一个完全平方数(某个整数的平方)的个数totcnt,以及满足此条件的这些数(右移前的值)的算术平均值totpjz,最后调用函数writedat( )把所求的结果输出到文件out.dat中。
部分源程序已给出。
请勿改动主函数main( )、读数据函数readdat( )和输出数据函数writedat( )的内容。
#include<stdio.h>
#include<conio.h>
#define MAXNUM 200
int xx[MAXNUM];
iht totnum=0;
iht totcnt=0;
double totpjz=0.0;
int readdat(void);
void writedat(void);
void calvalue(void)



void main ( )

int i;
clrscr ( );
for (i=0; i if (readdat ( ))

printf("Can’t open the data file in.dat!/007/n");
return;

calvalue ( );
printf ( "totnum=%d/n", totnum);
printf ( "totcnt=%d/n" , totcnt );
printf ( "totpj z=%. 21f/n", totpj z);
writedat ( );

int readdat (void)

FILE *fp;
int i=0;
if(
[简答题]已知在文件IN13.DAT中存有若干个(个数<200)4位数字的正整数,函数ReadDat( ) 的功能是读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求:(1)求出该文件中共有多少个正整数totNum;(2)求这些数右移1位后,产生的新数是偶数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz,最后调用函数WriteDat( )把所求的结果输出到文件OUT13.DAT中。注意:部分源程序已给出。请勿改动主函数main( )、读函数ReadDat( )和写函数WriteDat( )的内容。试题程序:#include #include #define MAXNUM 200int xx[MAXNUM];int totNum = 0; /* 文件IN13.DAT中共有多少个正整数 */int totCnt = 0; /* 符合条件的正整数的个数 */double totPjz = 0.0; /* 平均值 */int ReadDat(void);void Writedat(void);void CalValue(void){ }main( ){int i;clrscr( );for(i = 0; i < MAXNUM; i++) xx[i] = 0;if(ReadDat( )) {printf("数据文件IN13.DAT不能打开!/007/n");return;}CalValue( );printf("文件IN13.DAT中共有正整数= %d 个/n", totNum);printf("符合条件的正整数的个数= %d 个/n", totCnt);printf("平均值=%.2lf/n", totPjz);Writedat( );}int ReadDat(void){FILE *fp;int i = 0;if((fp = fopen ("IN13.DAT", "r")) == NULL) return 1;while(! feof(fp)) {fscanf(fp, "%d,", &xx[i++]);}fclose(fp);return 0;}void WriteDat(void){FILE *fp;fp = fopen("OUT13.DAT", "w");fprintf(fp
[简答题]已知在文件in96.dat中存有若干个(个数<200)4位数字的正整数,函数ReadDat( )读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求是:(1)求出这个文件中共有多少个正整数totNum;(2)求这些数右移一位后,产生的新数是奇数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz。最后调用函数WriteDat( )把所有结果输出到文件out96.dat中。
注意:部分源程序已给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数WriteDat( )的内容。
试题程序:
#include <stdio.h>
#include <stdlib.h>
#define MAXNUM 200
int xx[MAXNUM];
int totNum=0;
int totCnt=0;
double totPjz=0.0;
int ReadDat(void);
void WriteDat(void);
void CalValue(void)


void main( )

int i;
system("CLS");
for(i=0;i<MAXNUM;i + +)
xx[i]=0;
if(ReadDat( ))

printf("数据文件IN96.DAT不能打开! /007/n");
return;

CalValue( );
printf("文件IN96.DAT中共有正整数=% d个/n",totNum);
printf("符合条件的正整数的个数=% d个/n",totCnt);
printf("平均值=% .21f/n",totPjz);
WriteDat( );

int ReadDat(void)

FILE * fp;
int i=0;
if((fp=fopen("IN96.DAT","r"))==NULL) retu
[简答题]已知在文件IN20.DAT中存有若干个(个数〈200)4位数字的正整数,函数ReadDat( )的功能是读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求:(1)求出这文件中共有多少个正整数totNum;(2)求出这些数中的各位数字之和是偶数的数的个数totCnt,以及满足此条件的这些数的算术平均值totPjz,最后调用函数WriteDat( )把所求的结果输出到文件OUT20.DAT中。
注意:部分源程序已给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数WriteDat( )的内容。
试题程序:
#include〈 s t dio. h>
#include〈conio.h>
#define MAXNUM 200
int xx [MAXNUM];
int totNum = 0; /* 文件 IN20.DAT 中共有多少个正整数 */
int totCnt = 0; /* 符合条件的正整数的个数 */
double totPjz = 0.0; /* 平均值 */
int ReadDat (void);
void Writedat(void); void CalValue( )


main ( )

int i;
clrscr ( );
for(i = 0; i〈 MAXNUM; i++)
xx[i] = 0;
if (Readdat ( ))

printf("数据文件 IN20.DAT不能打开!/007/n");
return;

CalValue ( );
printf("文件 IN20.DAT 中共有正整数=%d个/n", totNum);
printf("符合条件的正整数的个数=%d个/n", totCnt);
printf("平均值=%.21f/n", totPjz);
Writedat ( );
int Re
[简答题]已知在文件IN65.DAT中存有若干个(个数<200)4位数字的正整数,函数ReadDat( )是读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求是: (1)求出这个文件中共有多少个正整数totNum。 (2)求出这些数中的各位数字之和是奇数的个数totCnt,以及满足此条件的这些数的算术平均值totPjz。最后调用函数WriteDat( )把所有结果输出到文件 OUT65.DAT中。
注意:部分源程序已给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数WriteDat( )的内容。
试题程序:
#include<stdio. h>
#include<conio. h>
#define MAXNUM 200
int xx [MAXNUM];
int totNum=0;
int totCnt=0;
double totPjz=0.0;
int ReadDat (void);
void WriteDat (void) void CalValue (void)

void main ( )

int i;
clrscr ( );
for ( i=0; i<MAXNUM; i++ )
xx[i]=0;
if (ReadDat ( ) )

printf ("数据文件IN65.DAT不能打开! /007/")
return;

CalValue ( );
printf ( "文件IN65.DAT中共有正整数=%d个/n",totNum);
printf ( "符合条件的正整数的个数=%d个/n", totCnt)
printf ( "平均值=%. 21f/n", totPjz);
WriteDat ( );

int ReadDat (void)

FILE *fp;
int
[简答题]已知在文件in70.dat中存有若干个(个数<200)4位数字的正整数,函数ReadDat( )是读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求是:(1)求出这个文件中共有多少个正整数totNum。 (2)求这些数右移一位后,产生的新数是奇数的数的个数totCnt,以及满足此条件的这些数(右移前的值)的算术平均值totPjz。最后调用函数WriteDat( )把所有结果输出到文件out70.dat中。
注意:部分源程序已给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数Wiltedat( )的内容。
试题程序:
# inc lude<stdio, h>
# inc lude<conio, h>
# define MAXNUM 200 int xx [MAXNUM];
int totNum=0;
int totCnt=0;
double totPjz=0.0;
int ReadDat (void);
void WriteDat (void); void CalValue (void)
void main ( )

int i;
clrscr ( );
for ( i=0; i<MAXNUM; i++ )
xx[i] =0;
if (ReadDat ( ))

printf ( "数据文件IN70. DAT 不能打开! /007/n" );
return;

CalValue ( );
printf ( "文件IN70.DAT中共有正整数=%d个/n", totNum);
printf ( "符合条件的正整数的个数=%d个/n", totCnt );
printf ( "平均值=%.21f/n", totPjz);
WriteDat ( );

int ReadDat (void)

FILE *
[简答题]已知文件IN.DAT中存有若干个小于200的四位正整数,函数ReadDat( )读取若干个正整数并将其存入数组xx中。请编制函数CalValue( ),其功能要求:求出这个文件中共有所少个正整数totNum;求这些数中的各位数字之和是奇数的数的个数totCnt,以及满足此条件的这些数的算术平均值totPjz;最后调用函数writeDat( )把求出的结果输出到文件OUT.DAT中。
注意:部分源程序已经给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数writeDAT( )的内容。
[试题源程序]
#inciude<stdio.h>
#include<conio.h>
#define MAXNUM 200
int xx[MAXNUM];
int totNum=0;
int totCnt=0;
double totPjz=0.0;
int ReadDat(void);
void writeDat(void);
void CaiVaiue(void)


void main( )

int i;
system("cls");
for(i=0;i<MAXNUM;i++) xx[i]=0;
if(ReadDat( ))

printf("数据文件IN.DAT不能打开!/007/n");
return;

CalValme( );
printf("文件IN.DAT中共有正整数=%d个/n",totNum);
printf("符合条件的正整数的个数=%d个/n",totCnt);
printf("平均值=%.2f/n",totpjZ);
writeDat( );

int ReadDat(void)

FILE *fp;
int i=0;
if((fp=fopen("IN.DAT","r"))==NULL) return 1;
while(!feof(fp))

fscan
[简答题]

已知在文件IN.DAT中存有若干个(<200)四位正整数,函数ReadDat( )读取若干个正整数并将其存入数组xx中。请编制函数CalValue( ),其功能要求:
(1)求出这个文件中共有多少个正整数totNum。
(2)求这些正整数中各位数字之和是奇数的正整数的个数totCnt,以及满足此条件的正整数的算术平均值totPjz,最后调用函数writeDat( )把结果输出到文件OUT.DAT中。
注意:部分源程序已经给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数、writeDAT( )的内容。
[试题源程序]
#inolude<stdio.h>
#iFIclude<conio.h>
#define MAXNUM 200
int xx[NAXNUN];
int totNum=0;
int totCnt=0;
double totPjz=0.0;
int ReadDat(void);
void writeDat(void);
void CalValue(void)


void main( )

int i;
system("cls");
for(i=0;i<NAXNUN;i++)xx[i]=0;
if(ReadDat( ))

printf("数据文件IN.DAT不能打开!/007/n");
return;

CalValue( );
printf("文件IN.DAT中共有正整数=%d个/n",totNum);
printf("符合条件的正整数的个数=%d个/n",totCnt);
printf("平均值=%.2f/n",totPjz);
writeDat( );

int ReadDat(VOid)

FI

[简答题]已知在IN.DAT文件中存有若干个(<200)四位数字的正整数,函数ReadDat( )读取这若干个正整数并存入数组xx中。请编写函数CalValue( ),其功能是:(1)求出文件中的正整数个数totNum;(2)求这些数中的各位数字之和是奇数的个数totCnt,以及满足此条件的这些数的算术平均值totPjz,最后调用函数writeDat( )把所求的数的结果输出到OUTDAT文件中。
注意:部分源程序已经给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数writeDat( )的内容。
#include<stdio.h>
#include<conio.h>
#define MAXNUM 200
int xx[MAXNUM];
int totNum=0; /*IN.DAT文件中的正整数个数*/
int totCnt=0; /*符合条件的正整数个数*/
double totPjz=0.0; /*平均值*/
int ReadDat(void);
void writeDat(void);
void CalValue(void)


void main( )

int i;
for(i=0; i<MAXNUM; i++)
xx[i]=0;
if(ReadDat( ))

printf("数据文件IN.DAT不能打开!/007/n");
return;

CalValue( );
printf("IN.DAT文件中的正整数个数=%d个/n",totNum);
printf("符合条件的正整数个数=%d个/n",totCnt);
printf("平均值=%.2f/n",totPjz);
writeDat( );

int ReadDat(void)

FILE *fp;
int i=0;
if((fp=fopen("IN.DAT","r"))==NULL)
return 1;
while(

我来回答:

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

订单号:

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