我正在尝试制作 cout<<intRate<<"\t\t";
语句从不同的位置开始 cout <<"\t\t"<<monPayment;
.我的问题是调整费率和付款值。
我得到的输出是什么:
Principal Interest Rate
0.07 0.075 0.08 0.085 0.09 0.095 0.1
_______________________________________________________________
100000 665.302 699.215 733.765 768.913 804.623 840.854 877.572
________________________________________________________________
Interest rate is greater than .10 and the value is.105
我试着让它看起来像这样:
Principal Interest Rate
0.07 0.075 0.08 0.085 0.09 0.095 0.1
_______________________________________________________________
100000 665.302 699.215 733.765 768.913 804.623 840.854 877.572
________________________________________________________________
Interest rate is greater than .10 and the value is .105
其中 0.07 与 665.302 对齐
最佳答案
很难从你的问题中判断出来,但听起来你正在寻找 iomanip
。
#include <iostream>
#include <iomanip>
int main()
{
std::cout << setw(4) << 1 << setw(4) << 2 << std::endl;
}
输出:
1 2
关于C++ 使用 TABS 间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5124939/