#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int amount;
int discount;
cout<<"please enter amount : ";
cin>>amount;
discount = amount*(10/100);
cout<<"the discount amount is"<<discount<<endl;
system("PAUSE");
}
私は単純な数式がint amount変数で計算されていますが、与えられていない単純なC++プログラムを書いています。必要な答えは0を与えるが、コードは正しいと思う。ユーザ入力のパーセンテージの計算に関する簡単なC++プログラム
デバッグしましたか? – Alex