新手请问:C++中对小数点后两位进行四舍五入,结果出现有关问题

新手请教:C++中对小数点后两位进行四舍五入,结果出现问题
 #include<iostream>
 #include<stdlib.h>
  using namespace std;
    float x;
void main()
  {
   cin>>"a\n";
   cout<<"getA(a):"<<endl;
   system("pause");

  }
   void getA(float x)
   {
   x= int((x+0.005)*100.)/100;
       };
c++ ,c++builder

------解决方案--------------------
#include<iostream>
#include<cstdlib> 

using namespace std;
void getA(double& x);

int main()
{
cout << "Input a: ";
double x;
cin >> x;
getA(x);
cout<< "getA(a): " << x <<endl;
system("pause");
return 0;
}

void getA(double& x)
{
   x= int((x+0.005)*100) / 100.0;
};