摘要:#include <bits/stdc++.h> using namespace std; #define ll long long char s[20],p[20]; int cnt; void solve(ll c){ if(c<0){ printf("-"); c=abs(c); } cnt = 0; while(c){//为0呢 s[cnt++] = char(c%10)+'0'; c/=
阅读全文
摘要:http://c.biancheng.net/view/2022.html int *p1[5] //指针数组 int (*p1[5])一样的 int (*p2)[5]//二维数组指针指针数组,每个元素都是指针,p1在32位环境下占4*5=20字节二维数组指针,是一个指针,它指向一个二维数组。p2占
阅读全文
摘要:#include using namespace std; int main() { srand((unsigned)time(NULL)); //产生的随机数范围是0~65536, for(int i = 0; i < 10;i++ ) cout << rand() << '\n'; cout << endl; ...
阅读全文
摘要:#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <map> #include <utility> #include <vector> #in
阅读全文
摘要:asd sa vdd dvaddvbfsv fb 时没反应了
阅读全文
摘要:1 (1)使特定位翻转 2 3 假设有01111010,想使其低4位翻转,即1变为0,0变为1。可以将它与00001111进行∧运算,即 4 5 6 7 结果值的低4位正好是原数低4位的翻转。要使哪几位翻转就将与其∧运算的该几位置为1即可。这是因为原数中值为1的位与1进行∧运算得0,原数中的位值0与1进行∧运算的结果得1。 8 9 10 快速判断两个值是否相...
阅读全文
摘要:DEVc++ 在编译时要把之前的窗口都必须关掉才可以再次编译
阅读全文
摘要:每一位不够减了,就借2,借的是上一位的,那么到了上一位时,还要还-1
阅读全文
摘要:第 76 题 请编写函数 fun,其功能时:计算并输出当 x=1e-6); return sum; } 请编写函数 fun,该函数的功能是:删去一维数组中所有相同的数,使之只剩 一个。数组中的数已按由小到大的顺序排列,函数返回删除后数组中数据的个数。 int f(int *a,int n) { for(int i=0;i<n;i++){ ...
阅读全文
摘要:1 int a,b; 2 long c; 3 void fun(int a,int b,long *c) 4 {*c=(b%10)*1000+(a%10)*100+(b/10)*10+a/10;} 5 int main() 6 { 7 scanf("%d%d",&a,&b); 8 long *p=&c; 9 fun(a,b,p); 10 prin...
阅读全文
摘要:1 p:指针 2 p->num 和(*p).num 等价
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std; 10 typedef long long ll; 11 const int inf=0x3f3f3f3f; 12 t...
阅读全文
摘要:unsigned int 0~4294967295 (10位数,4e9) int -2147483648~2147483647 (10位数,2e9 2^31 - 1) long long: -9223372036854775808~9223372036854775807 (19位数, 9e18 )
阅读全文
摘要:1 https://baike.baidu.com/item/%E8%BF%90%E7%AE%97%E7%AC%A6%E4%BC%98%E5%85%88%E7%BA%A7/4752611?fr=aladdin * / % + -
阅读全文
摘要:int n; int main() { scanf("%d",&n); cout>b == a/(2^b) &&还具有短路的功能,即如果第一个表达式为false,则不再计算第二个表达式 int a[5]; char c ='d'; for(int i=0;i<4;i++) a[i]=i; for(int i=0;i<...
阅读全文
摘要:1 如果 x>0&&x&(x-1)==0 那么x为2的指数幂 0&(-1)==0
阅读全文
摘要:1 局部数组:没有默认值,如果声明的时候不定义,则会出现随机数(undefined);如果声明的长度与赋值长度不相等,则有,声明的长度>赋值长度,后面用0补足,声明的长度>赋值长度,发生编译错误; 2 3 4 5 全局数组:声明时不赋值,默认值为0 6 在所有函数(包括主函数)之外定义的变量称为“全局变量”。
阅读全文
摘要:1 例如:一个字符串 awbcdewgh 2 3 他的子串: awbc、awbcd、awbcde ...很多个子串 ,但是都是连续在一起 。//substring 4 5 他的子序列:(subsequence ) abc 、abcd、 abcde ... 很多个子序列 ,但是子序列中的字符在字符串中不一定是连在一起的,而是删除其中若干个, 但是子序列一定是单调的(即字符之间ASC...
阅读全文
摘要:1 1 //强制类型转换 2 2 // https://blog.csdn.net/chaipp0607/article/details/54834954 3 4 double x; 5 int y1,y2; 6 scanf("%lf",&x); 7 y1=int(x); 8 y2=int(round(x)); 9 pri...
阅读全文