1
我想C++編寫一個非常簡單的程序,發現兩個數的模數如下:C++模量小程序問題
#include <iostream>
using namespace std;
int n;
int d;
int modulus;
int main()
{
cout<<"***Welcome to the MODULUS calculator***";
cout<<"Enter the numerator, then press ENTER: ";
cin>>n;
cout<<"Enter the denominator, then press ENTER: ";
cin>>d;
modulus=n%d;
cout<<"The modulus is ---> "<<modulus;
return 0;
}
但是,當我嘗試編譯它,我得到以下:
這又如何解決呢?
謝謝。
你有沒有讀過錯誤信息? – sharptooth 2011-01-19 11:35:13