Financial Management
思路:一道水题,循环求和然后除以12即可,注意格式。
代码:
#include<iostream> using namespace std; int main(){ double sum = 0.0; for (int i = 0; i < 12; i++){ double num = 0; cin >> num; sum = sum + num; } printf("$%0.2lf", sum/12); system("pause"); return 0; }