void func(char arr[100]){ coutusing namespace std;void myF( char arr[100]){ cout<<sizeof(arr)<<endl;}int main(void){ char arr[100]; myF(a...
分类:
编程语言 时间:
2014-07-13 21:15:06
阅读次数:
175
如题,矩阵行列之和放入另外另个数组,并且要求输出时,每行之后紧跟行的和,列下面紧跟列之和具体代码如下: 1 #include 2 using namespace std; 3 4 int main() 5 { 6 int i, j; 7 int A[5][5] = { 23, 45...
分类:
其他好文 时间:
2014-07-13 20:33:18
阅读次数:
231
1 #include 2 #include 3 #include 4 #include 5 #define MAXN 25 6 using namespace std; 7 int h,w; 8 int ans; 9 int dir[4][2]={-1,0,1,0,0,-1,0,1};10 cha....
分类:
其他好文 时间:
2014-07-13 20:30:45
阅读次数:
215
using namespace stdstd 是一个命名空间..不同的命名空间可以有相同的类名被定义 ..using namespace std;就是指明下面的程序使用std,如果不用这句指明的话就要用std::string(string是std空间中定义的也可以在全局空间中定义,只要名字空间不一样...
分类:
其他好文 时间:
2014-07-13 20:08:15
阅读次数:
177
Add All题意:最优二叉树(priority_queue实现)#include #include #include using namespace std;int main(int argc, char *argv[]){ int n, i, j, a, sum[6000]; pri...
分类:
其他好文 时间:
2014-07-13 20:03:13
阅读次数:
218
1 #include // 预处理命令 2 using namespace std; 3 4 class Student{ // 声明一个类,类名为Student 5 6 private :...
分类:
编程语言 时间:
2014-07-13 19:51:57
阅读次数:
174
c++ 函数的函数声明只要在被调用函数的首部的末尾加一个分号,就成为对该函数的函数声明。函数声明的位置应当在函数调用之前。#include using namespace std;int main( ){ int max(int x,int y); //对max函数作声明 int ...
分类:
编程语言 时间:
2014-07-13 19:46:46
阅读次数:
174
论文啊,04年一个人的论文。原来线段树还可以这么用。贴代码。#include#include#includeusing namespace std;const int MAX=10005;class BIT{public:int a[MAX<<1];void insert(int pos,int x...
分类:
其他好文 时间:
2014-07-13 19:08:03
阅读次数:
221
点击打开链接
题意:有n层楼层,现在在每一层有两个按钮,分别为up和down,按动按钮时,可以向上或向下跳动num[ i ]层;问能否以最少的次数从A到B层,不能输出-1;
解析:构图,将从i层到按动按钮后跳转的楼层,看作连通状态,赋值为1,这样就转换成单源最短路问题;
#include
#include
#include
using namespace std;
const int m...
分类:
其他好文 时间:
2014-07-13 18:37:00
阅读次数:
231
解题思路:
一段时间的速度*这一段时间=这一段时间走得距离,几段时间距离和累加就可以了。
代码:
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
int n;
int s[12],t[12];
int main()
{
whil...
分类:
其他好文 时间:
2014-07-13 16:35:55
阅读次数:
187