游客 Signup | Login
中文 | En

2641 - 求和和平均数

已知一个整数为35,另一个整数为8,求它们的和与平均数,请编程实现。
输出格式:
共两行
第一行为和,输出场宽为3
第二行为平均数,输出场宽为5,保留2位小数

Input

Output

 43

21.50

Examples

Input

no input needed

Output

 43
21.50

Solution C++

#include<iostream>
#include<iomanip>
using namespace std;
int main()
{int a=35,b=8;
float c;
cout<<setw(3)<<a+b<<endl;
cout<<setiosflags(ios::fixed);
cout.precision(2);
c=(a+b)/2.00;
cout<<setw(5)<<c<<endl;
return 0;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题