码迷,mamicode.com
首页 >  
搜索关键字:unsigned    ( 4409个结果)
算法交作业之最大公约数
今天写一下最大公约数算法,英文简称为Gcd算法。 1.递归解法:/*书上并没有给出递归的解法,可能是觉得这个解法不是很完美,但是给出来就当学习下递归。*/ int Gcd(unsigned num1, unsigned num2){ if (num1 == 0 || num2 == 0)//算法基于欧几里德的算法。 return (num1 > num2) ? num1 :...
分类:编程语言   时间:2015-04-10 22:33:05    阅读次数:207
CQOI2015 选数+酱油记
昨天我们考了CQOI2015的题。。那还是找一道最可做的写一写好了>..#define ll long long//#define uint unsigned intint p[1001000]={0},P=0,ans=0;int N,K,L,H,mod=1000000007,fx;bool mar...
分类:其他好文   时间:2015-04-10 21:45:46    阅读次数:1118
Objective-C NSNumber方法
//这几天的内容大部分都是方法的,可能在看的时候感觉没有什么可学的,但是这些东西后续都会涉及到,最好还是能够敲一遍,这样在后面遇到的时候就不会感到陌生!NSNumber 是一个类继承于NSValue 即一个基本数据类型的集合 包括char a signed or unsigned char, sho...
分类:其他好文   时间:2015-04-10 21:41:16    阅读次数:155
用C语言写一个程序,得出当前系统的整形数字长(16位,32位,64位)等,不能使用sizeof()
#include #include using namespace std;int main(){ int num = -1; unsigned int s = num; //当前位级表示即为最大无符号数 cout > 1; intSize = intS...
分类:编程语言   时间:2015-04-10 21:40:02    阅读次数:153
malloc()的用法
malloc的全称是memory allocation,中文叫动态内存分配,当无法知道内存具体位置的时候,想要绑定真正的内存空间,就需要用到动态的分配内存。原型为extern void *malloc(unsigned int num_bytes)。在使用上,malloc 和 new 至少有两个不同...
分类:其他好文   时间:2015-04-10 17:40:57    阅读次数:121
191 Number of 1 Bits
最近想刷一下LeetCode练习一下数据结构算法之类的,先从水题开始吧题目是这样的Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theH...
分类:其他好文   时间:2015-04-10 13:11:14    阅读次数:117
iOS 获取文件大小fileSize && 文件删除
NSDictionary *fileAttributes = [[NSFileManager defaultManager] fileAttributesAtPath:path traverseLink:YES];     unsigned long long length = [fileAttributes fileSize];     float ff = length/1024.0/10...
分类:移动开发   时间:2015-04-10 11:28:02    阅读次数:173
proc_dir_entry
struct proc_dir_entry {unsigned int low_ino;unsigned short namelen;const char *name;mode_t mode;nlink_t nlink;uid_t uid;gid_t gid;loff_t size;const st...
分类:其他好文   时间:2015-04-09 21:32:59    阅读次数:142
实验1-四则运算
#includeusing namespace std;#include#includeint main(){ int a,b,ans,res,c1=0,c2=0,c3=0,c4=0,t,i,N; int p; srand((unsigned)time(NULL)); while(1) { cou....
分类:其他好文   时间:2015-04-09 19:38:01    阅读次数:205
fd_set的具体实现过程
fd_set的实现详细原理 define FD_SETSIZE 1024 typedef unsigned long fd_mask; #define NBBY 8 /* number of bits in a byte */ #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mas...
分类:其他好文   时间:2015-04-09 17:29:53    阅读次数:149
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!