主题:请大家帮我看一下这个小程序哪里错了
#include <iostream>
using namespace std;
const int a =1000 ;
const int b =100 ;
const int c =10 ;
int main ()
{
double change;
int x;
cout<<"please enter a change"<<endl;
cin>>change;
cout<<endl;
x=change/a;
cout<<x<<endl;
change=change%a;
x=change/b;
cout<<x<<endl;
change=change%b;
x=change/c;
cout<<x<<endl;
change=change%c;
cout<<change<<endl;
return 0;
}
using namespace std;
const int a =1000 ;
const int b =100 ;
const int c =10 ;
int main ()
{
double change;
int x;
cout<<"please enter a change"<<endl;
cin>>change;
cout<<endl;
x=change/a;
cout<<x<<endl;
change=change%a;
x=change/b;
cout<<x<<endl;
change=change%b;
x=change/c;
cout<<x<<endl;
change=change%c;
cout<<change<<endl;
return 0;
}