文件名称:28
介绍说明--下载内容来自于网络,使用问题请自行百度
先创建文本文件IN.DAT,在文件中写20个四位整数。
编写函数readDat()把从文件中读出这些数并存入数组a中;编写函数Calvalue( ), 其功能要求:
1. 求出这文件中共有多少个正整数totNum
2. 求这些数右移1位后, 产生的新数是偶数的数的个数totCnt, 以及满足此条件的这些数(右移前的值)
的算术平均值totPjz。
最后在main( )函数中把所求的结果输出。-First create a text file IN.DAT, wrote in the paper four integer 20. The preparation of function readDat () to read from the file into an array of these and a number of preparation function Calvalue (), its functional requirements: 1. Obtained in this paper the total number of positive integer totNum 2. For those few shifted to right one after the new number is the number of even a few totCnt, as well as to meet the conditions of these (the value of the pre-shifted to right) the arithmetic mean totPjz. Finally, in the main () function to output the results of the request.
编写函数readDat()把从文件中读出这些数并存入数组a中;编写函数Calvalue( ), 其功能要求:
1. 求出这文件中共有多少个正整数totNum
2. 求这些数右移1位后, 产生的新数是偶数的数的个数totCnt, 以及满足此条件的这些数(右移前的值)
的算术平均值totPjz。
最后在main( )函数中把所求的结果输出。-First create a text file IN.DAT, wrote in the paper four integer 20. The preparation of function readDat () to read from the file into an array of these and a number of preparation function Calvalue (), its functional requirements: 1. Obtained in this paper the total number of positive integer totNum 2. For those few shifted to right one after the new number is the number of even a few totCnt, as well as to meet the conditions of these (the value of the pre-shifted to right) the arithmetic mean totPjz. Finally, in the main () function to output the results of the request.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
28.cpp
1999-2046 搜珍网 All Rights Reserved.
本站作为网络服务提供者,仅为网络服务对象提供信息存储空间,仅对用户上载内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
