易码技术论坛

 找回密码
 加入易码
搜索
查看: 79188|回复: 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题....这个不用我多说了
nznthunan 该用户已被删除
 楼主| 发表于 2005-4-30 19:44:02 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 加入易码

本版积分规则

Archiver|手机版|小黑屋|EMAX Studio

GMT+8, 2025-6-15 15:03 , Processed in 0.011950 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表