HDU 1265 Floating Point Presentation

想了老半天,用了很复杂的过程。。结果WA了,去问了别人,才知道,可以一个函数搞定

哎,水平还是不行,需要提高啊

#include <iostream>
using namespace std;
int main()
{
 long n,x;
 float m;
 cin >> n)
 while (n--)
 {
  cin >> m;
  memcpy(&x,&m,4);
  printf("%lX\n",x);
 }
 return 0;
}

posted @ 2008-08-27 20:42  cnnbboy  阅读(176)  评论(0编辑  收藏  举报