我使用這個代碼,找出匯率我不能讓C++ for循環輸出右
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double r, c;
cout<<"Input Exchange Rate: US Dollar to Yen: ";
cin>>r;
cout<<"Input cash on hand: ";
cin>>c;
cout<<fixed<<setprecision(2);
cout<<"\tUS Dollar\tYen\n";
for (int u=1; u<=c; u++)
cout<<'\t'<<u<<'\t'<<u*r<<endl;
return 0;
}
我希望我的輸出首先由那些然後再出現幾十上百 但我得到這篇
你能告訴我們究竟你希望它的輸出? – HolyBlackCat
您的文字圖像[不是很有幫助](// meta.unix.stackexchange.com/q/4086)。它不能被朗讀或複製到編輯器中,而且它的索引也不是很好,這意味着具有相同問題的其他用戶不太可能在此找到答案。請[編輯]您的文章直接合並相關文本(最好使用複製+粘貼以避免轉錄錯誤)。 –