1.average:#include<iostream>
using namespace std;
int main() {
double a, b, c;
cout << "请输入第一个数" << endl;
cin >> a;
cout << "请输入第二个数" << endl;
cin >> b;
cout << "请输入第三个数" << endl;
cin >> c;
cout.precision(3);
cout << fixed;
cout << "平均值是" << endl;
cout << (a + b + c) / 3;
system("pause");
return 0;
}
2.temperature:#include<iostream>
using namespace std;
int main() {
double f, c;
cout << "请输入华氏温度" <<endl;
cin >> f;
c = 5*(f - 32) / 9;
cout.precision(3);
cout << fixed;
cout << "摄氏温度为" << c << endl;
system("pause");
return 0;
}