输入一个正整数,将该数写成若干个素数相乘的形式,例如,10=2*5,24=2*2*2*3,结果在输出对话框显示。用V

[复制链接]
查看11 | 回复1 | 2010-12-27 16:22:38 | 显示全部楼层 |阅读模式
经过我多方面的优化, 函数速度非常的快, 输入数据为unsigned _int64, 也就是最大值为18446744073709551615.#include "windows.h"unsigned __int64 sqrt64(unsigned __int64 x){ int i=(sizeof(unsigned __int64)=0) {if((x>>i)==1) break;i--; } return (unsigned __int64)1<
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行