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

[简答题]已知在文件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

更多"已知在文件in96.dat中存有若干个(个数<200)4位数字的正整数"的相关试题:

[多项选择]已知文件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
[简答题]已知在文件IN95.DAT中存有若干个(个数<200)4位数字的正整数,函数ReadDat( )的功能是读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求是:(1)求出这个文件中共有多少个正整数totNum;(2)求出这些数中的各位数字之和是奇数的个数totCnt,以及满足此条件的这些数的算术平均值totPjz。最后调用函数WriteDat( )把所有结果输出到文件OUT95.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("数据文件IN95.DAT不能打开! /007/n");
return;

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

int ReadDat(void)

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


void main( )

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

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

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

int Readdat(void)

FILE * fp;
int i=0;
if((fp
[简答题]已知在文件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)的4位数字的正整数,函数ReadDat( )读取若干个正整数并存人数组xx中。请编制函数CalValue( ),其功能要求:(1)求出这文件中共有多少个正整数totNum;(2)求这些数中的各位数字之和是奇数的数的个数totCnt,以及满足此条件的这些数的算术平均值totPjz,最后调用函数writeDat( ),把所求的结果输出到文件out.dat中。
注意:部分源程序已经给出。
请勿改动主函数main( )、读函数ReadDat( )和写函数writeDAq、( )的内容。
[试题源程序]
#include<stdio.h>
#include<conio.h>
#define MAXNUM 200
int xx[MASNUM];
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("数据文件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;<
[简答题]已知在IN.DAT文件中存有若干个(<200)四位数字的正整数,函数ReadDat( )读取若干个正整数并存入数组xx中。请编写函数CalValue( ),其功能是:(1)求出这文件中共有多少个正整数totNum;(2)求这些数中的各位数字之和是偶数的数的个数totCnt,以及满足此条件的这些数的算术平均值totPjz,最后调用函数writeDat( )把所求的结果输出到OUT.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;
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(!feof(fp))
fscanf(fp,"%d,",&xx[i++]);
[简答题]已知在IN.DAT中存有若干个(个数<200)四位数字的正整数,函数ReadDat( )读取这若干个正整数并存入数组xx中。请编制函数CalValue( ),其功能要求:1.求出这文件中共有多少个正整数tofNum;2求这些正整数右移1位二进制位后,产生的新数是奇数的数的个数totCnt,以及满足此条件的这些正整数(右移前的值)的算术平均值cotPjz。最后main( )函数调用函数WriteDat( )把所求的结果输出到文件OUT.DAT中。
注意:部分源程序存放在PROG1.C中。请勿改动数据文件IN.DAT中的任何数据,主函数main( )、读函数ReadDat1( )和输出函数WriteDat( )的内容。
[试题程序]
#include
#define MAXNUM 200
int XX[MAXNUM];
int totNum=0;/*文件INDAT中共有多少个正整数*/
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(“平均值=%.2lf/n”,totpjz);
WriteDat( );

int ReadDat(void)

FILE *fp;
int i=0;
if((fp=fopen("in.dat","r")==NULL)
[简答题]已知在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
我已记住账号密码