- 博客(5)
- 收藏
- 关注
转载 数组赋值的问题
但用指针 char *p=NULL; p="computer"; 可以。 char a[3]; a[3]="oq"; error: invalid conversion from `const char*' to `char'| a[3]是char 而“oq”是char*,不能赋值 --------------------------...
2014-01-20 22:43:00
320
转载 字符串中的0 其实是“0” 而不是 bool 的0
#include <iostream> using namespace std; int main() { char *p=NULL; p="com\0hputer"; while(*p){ cout << *p; p++; } return 0; }...
2014-01-20 22:19:00
390
转载 c++字符串指针地址的输出
#include <iostream> using namespace std; int main() { char *p=NULL; p="computer"; cout<<p; return 0; } 输出 computer而不是字符串的地址,如果要输出地址 可以 用 p...
2014-01-20 22:16:00
458
转载 贪心法 找零算法 c++
//自己写的找零贪心算法 #include <iostream> using namespace std; int main() { float mianer[]={100,50,10,5,1,0.5,0.1}; int fanan[]={0,0,0,0,0,0,0}; float qianshu; cout<...
2014-01-19 08:44:00
428
转载 贪心法 装箱算法 c++
//参考书上的算法 #include <iostream> #define N 12 #define V 100 using namespace std; typedef struct box{ int id; int boxsize; struct box* next; }BOX; void initboxlist(BOX ** H) { ...
2014-01-18 23:18:00
198
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅