You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
698 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include<bits/stdc++.h>
using namespace std;
//注意精度
long double S, T;
int main() {
/**
假设该程序编译得到的可执行程序是 mycin.exe。在 Windows 系统中,通过键盘输入时,
在单独的一行按 Ctrl+Z 键后再按回车键,就代表输入结束。因此程序运行时,输入若干个正整数后换行,
再按 Ctrl+Z 键和回车键程序就会输出最大值并结束。即cin>>n这个表达式在碰到 Ctrl +Z 时,会返回 false。
在 UNIX/Linux 系统中Ctrl+D 代表输入结束。
*/
while ((cin >> T) != 0) {
S += T * 1000000;
}
cout << fixed << setprecision(5) << S / 1000000;;
return 0;
}