- 注册时间
- 2005-4-16
- 最后登录
- 1970-1-1
|
发表于 2005-4-30 23:08:00
|
显示全部楼层
看样子楼主也是数学系或者搞计算机的了
1.: method 1
int a;a-a/1000*1000;
now we get last number;
store it in a numberarray;
then loop,it's clearly that we should use 100 devides a....-_-;
method 2:
change the number into string,then it's very simple.
i will give u a class,whilch was just written by me and it can be find in some head file;
CString shutost(long a)//the function can be rewritten.
{
CString fh;
char c[10];
long b,i,j;
i=1;
while(a>0)
{ b=a-a/10*10;
a=a/10;
c=b+48;
i++;
}
i--;
for(j=i;j>0;j--)
fh=fh+c[j];
return fh;
}
2.:对2,3题如果直接这样展开的话精度不会提高得很快,建议进行插值.
对此,我们只需要编写一个进行N位计算的类,很简单的-_-.
3:对第4题....这个不用我多说了
|
|