C++简洁代码:
平均身高
http://www.nowcoder.com/questionTerminal/b0e489a749f448e2b37f26ef56a76e58
C++简洁代码:
#include<bits/stdc++.h>
using namespace std;
int main() {
float temp, res = 0;
while(cin >> temp) res += temp;
printf("%.2f",0.2 * res); //方法一,C语言
//cout << setiosflags(ios::fixed) << setprecision(2); //方法二,c++
//cout << 0.2 * res <<endl;
return 0;
}
