#include<iostream>
int main(){
unsigned short quantity;
float price;
float taxRate;
quantity=16;
price=6.04;
taxRate=0.05;
std::cout<<"The cost of purchasing"
<<quantity<<"widget(s) at a price of $"
<<price<<",with tax,comes to $";
std::cout<<( (quantity*price)+((quantity*price)*taxRate) )<<".\n";
std::cout<<"press enter orreturn to continue.\n";
std::cin.get();
return 0;
}
到底是哪儿出了问题。。
int main(){
unsigned short quantity;
float price;
float taxRate;
quantity=16;
price=6.04;
taxRate=0.05;
std::cout<<"The cost of purchasing"
<<quantity<<"widget(s) at a price of $"
<<price<<",with tax,comes to $";
std::cout<<( (quantity*price)+((quantity*price)*taxRate) )<<".\n";
std::cout<<"press enter orreturn to continue.\n";
std::cin.get();
return 0;
}
到底是哪儿出了问题。。