码迷,mamicode.com
首页 >  
搜索关键字:unsigned    ( 4409个结果)
[题解]第十一届北航程序设计竞赛预赛——H.高中数学题
题目描述解题思路可以求得通项公式:an = 2n + 1,所以问题就变成等差数列求异或和,这个具体为什么对我还不能很好地解释清楚,先挖坑吧。附:c++代码 1 #include 2 #include 3 4 using namespace std; 5 6 typedef unsigned ...
分类:其他好文   时间:2015-12-15 22:40:31    阅读次数:201
简单的猜数游戏
#include<stdio.h> #include<stdlib.h> intmain() { intk=0; intcount=0; srand((unsigned)time(NULL)); inta=rand()%100; inti=rand()%100; for(k=0;k<2;) { count++; intj=0; printf("请输入一个0~99之间的数字:"); scanf("%d",&j); if..
分类:其他好文   时间:2015-12-15 19:41:17    阅读次数:203
Sizeof与Strlen的区别与联系
Sizeof与Strlen的区别与联系1.sizeof操作符的结果类型是size_t,它在头文件中typedef为unsigned int类型。该类型保证能容纳实现所建立的最大对象的字节大小。 2.sizeof是算符,strlen是函数。 3.sizeof可以用类型做参数,strlen只能用char...
分类:其他好文   时间:2015-12-14 10:34:42    阅读次数:206
c++中basic_istream::getline()的返回值何时为真
今天在看primer,17ch中的IO库再探,做课后练习,要求用ifstream.getline(char*, const unsigned, char)读取一个文件,用循环:while(ifs.getline(str,10,'\n'))来读取文件,但while的判断条件一直为假,也就是说ifs.g...
分类:编程语言   时间:2015-12-11 22:18:02    阅读次数:263
《C和指针》章节后编程练习解答参考——第10章
10.1 1 #include 2 3 typedef struct 4 { 5 unsigned char QuHao[5]; 6 unsigned char Exchange[10]; 7 unsigned char StnNum[10]; 8 }TelphoneN...
分类:其他好文   时间:2015-12-10 16:29:04    阅读次数:127
重写String类,也有些区别,供参考
头文件如下:#pragma once#include #include #include #include #include using namespace std;typedef int BOOL;#define FALSE 0#define TRUE 1typedef unsigned c...
分类:其他好文   时间:2015-12-10 13:32:47    阅读次数:207
c语言实现猜数字小游戏
#include<stdio.h>#include<stdlib.h>#include<time.h>voidfun(intc){srand((unsigned)time(NULL));intret=rand()%100+1;printf("请输入一个数>");while(1){scanf("%d",&c);if(c==ret){printf("正确\n");break;}elseif(c>ret){printf("猜大了\n");..
分类:编程语言   时间:2015-12-09 20:03:34    阅读次数:228
图像处理卷积算法实现
今天心血来潮,想把传统的卷积算法实现一份不采用各种加速方式,仅优化算法逻辑的纯净版本。写完发现性能还可以,特发出来分享之,若有博友在此基础上,进行了再次优化,那就更赞了。算法很简单:inline unsigned char Clamp2Byte(int n) { return (((255 - .....
分类:编程语言   时间:2015-12-08 20:02:14    阅读次数:260
leetcode Reverse Bits
题目连接https://leetcode.com/problems/reverse-bits/Reverse BitsDescriptionReverse bits of a given 32 bits unsigned integer.For example, given input 432615...
分类:其他好文   时间:2015-12-08 10:04:29    阅读次数:109
C语言编写猜数字的小游戏
#include<stdio.h>#include<stdlib.h>#include<time.h>intmain(){ intnum; srand((unsigned)time(NULL)); intret=rand()%100+1; while(1) { printf("请输入一个数字>>\n"); scanf("%d",&num); if(num>ret) printf("猜大了!"); if(num<..
分类:编程语言   时间:2015-12-08 07:16:28    阅读次数:128
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!