?? 銀行.txt
字號:
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <iomanip>
using std::setw;
using std::fixed;
using std::setprecision;
int main()
{
int money;
cout<<"Please input your money(>1000 and multiple)"<<endl;
cin>>money;
while (money%1000!=0)
{
cout<<money<<" is not multiple of 1000"<<endl;
cout<<"Please input your money(>1000 and multiple)"<<endl;
cin>>money;
}
cout<<"Please input everyday net value in this week:"<<endl;
int counter;
counter=1;
double today;
double yesterday;
yesterday=1;
today=1;
double sum;
sum=0;
while (counter<=5)
{
int Quotient;
double NetValue;
double IncreaseRate;
int CurrentValue;
int Currentpayoff;
yesterday=today;
cin>>today;
counter=counter+1;
sum=sum+today;
if (counter==2)
cout<<"Quotient Net Value Increase Rate Current Value Current payoff"<<endl;
Quotient=money*(1-0.015)/1;
NetValue=today;
IncreaseRate=(today-yesterday)/yesterday*100;
CurrentValue=today*Quotient;
Currentpayoff=CurrentValue*(1-0.005)-money;
cout<<fixed<<setw(8)<<Quotient<<" ";
cout<<fixed<<setprecision(4)<<setw(14)<<NetValue<<" ";
cout<<fixed<<setprecision(2)<<setw(14)<<IncreaseRate<<"% ";
cout<<fixed<<setw(15)<<CurrentValue<<" ";
cout<<fixed<<setw(16)<<Currentpayoff<<endl;
}
cout<<"Average Net Value in this week = "<<sum/5<<endl;
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -