不是VIP会员,不能显示答案

题目解答

题目:
#include <iostream>
using namespace std;

int main() {
int max, min, sum, count = 0;
int tmp;
cin >> tmp;
if (tmp == 0)
return 0;
max = min = sum = tmp;
count++;
while (tmp != 0) {
cin >> tmp;
if (tmp != 0) {
sum += tmp;
count++;
if (tmp > max)
max = tmp;
if (tmp < min)
min = tmp;
}
}
cout << max << "," << min << "," << sum / count << endl;
return 0;
}

输入: 1 2 3 4 5 6 0 7
输出:6,1,3
考点:
分析:
解答:
评论:
老师: