摘要: int poww(int a, int b) { int ans = 1, base = a; while (b != 0) { //如果b的所有位都被踢掉 也就是b不存在了 那么就没有指数了 就算不出下去了 也没有可以算得了 也不需要算了 就可以跳出循环 if (b & 1 != 0) //判断b 阅读全文
posted @ 2018-12-01 11:59 darrrr 阅读(324) 评论(0) 推荐(1) 编辑
摘要: C++常用库函数 1.缓冲区操作函数 函数名:memchr 函数原型:void *memchr(const void *buf,int c,sizet count); 参数:buf 缓冲区的指针;c 查找的字符;count 检查的字符个数。 所需头文件:<cstring> 功能:查找 buf 的前 阅读全文
posted @ 2018-12-01 11:09 darrrr 阅读(5342) 评论(0) 推荐(0) 编辑
摘要: 基本代码: #include <iostream>#include <algorithm>using namespace std;int PowerMod(long long a, long long b, int n){ int ans=1; a=a%n; while(b>0) { if(b%2= 阅读全文
posted @ 2018-12-01 10:38 darrrr 阅读(141) 评论(0) 推荐(0) 编辑