用C++编写程序,要求用户输入一系列的整数,计算所输入数中最大值以及它出现的次数。

日期:2015-04-20 21:56:11 人气:1

用C++编写程序,要求用户输入一系列的整数,计算所输入数中最大值以及它出现的次数。

//#include "stdafx.h"//vc++6.0加上这一行.#include using namespace std;int main(void){ int n,max=1> n){ if(n>max){ max=n; sum=1; } else if(n==max) sum++; } cout <&
    A+
热门评论