算法竞赛 习题 1-1 平均数(average)

版权声明:原创博客转载前请私信或评论,一天之内回复。 https://blog.csdn.net/qq_42381849/article/details/90722315

easy
输入三个整数,输出他们的平均值。

Thought:

数值转换的技巧

Code:

#include <bits\stdc++.h>
using namespace std;

int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    double res;
    res = (a+b+c)/3.0;

    cout << res << endl;
}

Output:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_42381849/article/details/90722315
今日推荐