- 博客(9)
- 收藏
- 关注
转载 矩阵顺时针打印(C++)(? 为什么不能AC,9度1391)
#include <iostream> #include <fstream> using namespace std; int a[1000][1000]; void printM(int m,int n) { for(int startX=0,startY=0,endX=m,endY=n;startX*2 < m &...
2013-08-24 20:56:00
134
转载 如何定义超大二维数组
#include <iostream> #include <fstream> #include <malloc.h> using namespace std; int main() { //定义超大二维数组方法一 int *p=new int[10000*10000]; p[2*1000+100]=1; ...
2013-08-24 13:35:00
2284
转载 如何生成均匀随机数 C++
#include <iostream> #include <fstream> #include <cstdlib> #include <ctime> using namespace std; int n=100,m=100000; double random() { return (double)rand...
2013-08-22 16:25:00
167
转载 C字符串和C++中string的区别
在C++中则把字符串封装成了一种数据类型string,可以直接声明变量并进行赋值等字符串操作。以下是C字符串和C++中string的区别: C字符串 string对象(C++) 所需的头文件名称 <string>或<string.h> <string>或<string.h&g...
2013-07-08 13:09:00
120
转载 计算字符串的相似度【转自编程之美】
#include <iostream> #include <fstream> #include <cstring> using namespace std; int minValue(int a,int b,int c) { int min=a; if(b<min) min=b; ...
2013-07-06 19:11:00
108
转载 链表的操作(但某些操作的结果有误)
#include <iostream> #include <fstream> #include <cstring> #include <malloc.h> #include <conio.h> using namespace std; typedef struct student { int d...
2013-07-04 15:49:00
113
转载 程序的输出结果是什么?
#include <iostream> using namespace std; int main() { int b=3; int arr[]={6,7,8,9,10}; int *ptr=arr; *(ptr++)+=123; cout<<*ptr<<' '<<*(++pt...
2013-07-02 15:51:00
832
转载 下面代码输出结果有何不同?
#include <iostream> using namespace std; void test1() { int a,x; for(a=0,x=0;a<=1&&!x++;a++) a++; cout<<a<<" "<<x<<endl; }...
2013-07-02 15:39:00
158
转载 求十进制数转化成二进制后包含1的个数
#include <iostream> using namespace std; int func(int x) //函数的关键代码 { int count=0; while(x) { x=x&(x-1); count++; } return count; } ...
2013-07-02 15:13:00
177
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅