- 1,题目描述:
-
2,注意:
因为第三个要求输出小数,所以求整数时必须是除以3.0
-
3,总代码:
#include<bits/stdc++.h>
using namespace std;
int main() {
int x,y,z;
double s;
cin>>x;
y = 3*x;
z = y-8;
s=(x+y+z)/3.0;
cout<<y<<endl;
cout<<z<<endl;
cout<<fixed<<setprecision(1)<<s;
return 0;
}