博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
简易乘方算法
阅读量:4563 次
发布时间:2019-06-08

本文共 698 字,大约阅读时间需要 2 分钟。

本乘方算法,只能计算整数long范围内乘方,主要是练习信号处理

 

#include
#include
using std::cin;using std::cout;using std::endl;long pows(long base,long time);int main(){ long t1,t2; for (;;) { try { cout<<"Please input the base number and how many times it is multiplied?"<
<<"example:8 13."<
>t1>>t2; if (cin) cout<
<
>tmp_test; if (cin&&tmp_test=='n') break; } catch (std::range_error err_ra) { cout<
<
max) { throw std::length_error("Too big a number"); } else { sum*=base; } } return sum; }}

转载于:https://www.cnblogs.com/huanyan/archive/2010/10/23/1858808.html

你可能感兴趣的文章
Harris角点检测
查看>>
Struts2的处理流程及为Action的属性注入值
查看>>
设计中最常用的CSS选择器
查看>>
Maven项目打包成可执行Jar文件
查看>>
nginx http proxy 正向代理
查看>>
对BFC的总结
查看>>
23醒
查看>>
win7每天出现taskeng.exe进程的解决方案
查看>>
React Children
查看>>
大数据等最核心的关键技术:32个算法
查看>>
Maven多模块项目搭建
查看>>
redis列表list
查看>>
雷林鹏分享: C# 简介
查看>>
ORA-12505: TNS: 监听程序当前无法识别连接描述符中所给出的SID等错误解决方法
查看>>
实用类-<Math类常用>
查看>>
构建之法阅读笔记之四
查看>>
10.15习题2
查看>>
Windows Server 2008 R2 备份与恢复详细实例
查看>>
Ubuntu上kubeadm安装Kubernetes集群
查看>>
关于java学习中的一些易错点(基础篇)
查看>>