作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<分区>
程序的要点是在您知道对角线尺寸和纵横比的情况下告诉您显示器的宽度和高度。这是我到目前为止的代码,但我不确定在给定数据时如何正确计算 widthIn 和 heightIn。
#include "stdafx.h"
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double width, height, diagonal, widthIn, heightIn, aspectRatio, mathPlaceholder;
//Data Collection
cout << "Enter the width value of the display: ";
cin >> width;
cout << "Enter the height value of the display: ";
cin >> height;
cout << "Enter the length of the diagonal in inches: ";
cin >> diagonal;
//Calculations
//Outputting Results
cout << "\n The width of your display is " << widthIn << " inches." << endl;
cout << "The height of your display is " << heightIn << " inches." << endl;
return 0;
}
我是一名优秀的程序员,十分优秀!