#include
#include
#include
using namespace std;
typedef struct coordinate{
int x;
int y;
int z;
}SCoordinate;
typedef struct input{
SCoordinate cTarget;
SCoordinate cInput;
}SInput;
int main(i...
分类:
其他好文 时间:
2015-07-12 01:50:04
阅读次数:
144
题目链接:http://poj.org/problem?id=3299#include #include using namespace std;double exp(double x){ double ans=1; double td=1; for(int i=1;i1){ ...
分类:
其他好文 时间:
2015-07-12 01:42:34
阅读次数:
129
怎样定义一个一维数组: 为N个连续变量分配存储空间 所有的变量数据类型必须相同 所有变量所占的字节大小必须相同 例子: int a[5]; 注意: 一位数组名不代表数组中所有的元素, 一位数组名代表数组中第一个元素的地址。 有关一位数组的操作: 初始化 ...
分类:
编程语言 时间:
2015-07-12 01:36:33
阅读次数:
158
题意:由01两个数字组成的十进制数,加起来等于n,求最少有多少个这样的数字
分析:灵活创新,思维转换;如:415=111+101+101+101+1,不用想什么十进制减法什么的
代码:
#include
using namespace std;
int main()
{
char a[10];
int i=0,hight=0;
while(cin>>a[i]) i++;
for(in...
分类:
其他好文 时间:
2015-07-12 00:22:19
阅读次数:
288
A ? B : C; 等价于if(A){ B;}else{ C;}/**目的:三目运算符的举例时间:2015年7月11日22:59:03*/#include int main(void){ int i; i = (2 > 3 ? 8 : 2); printf("i = %d\n",i); ...
分类:
其他好文 时间:
2015-07-12 00:12:56
阅读次数:
98
/**目的:逗号表达式的例子时间:2015年7月11日23:11:11*/#include int main(void){ int i; int j = 2; i = (j++, ++j, j + 2, j - 3); printf("i = %d\n",i); printf("j = %d\n.....
分类:
其他好文 时间:
2015-07-12 00:11:37
阅读次数:
168
#include#include#include#include#includeusing namespace std;int dp[30][30][30][30];int vis[30][30][30][30];int a[2][30],sum[2][30];int dfs(int i,int j...
分类:
其他好文 时间:
2015-07-12 00:07:23
阅读次数:
178
#include#includeint** fmalloc(int n){ int** array; int i; array = (int** )malloc(sizeof(int*) * n); for(i=0; i<n; ++i){ array[i] = (int*)malloc(sizeo....
分类:
其他好文 时间:
2015-07-12 00:07:01
阅读次数:
139
This problem has a very easy recursive code as follows. 1 class Solution { 2 public: 3 bool hasPathSum(TreeNode* root, int sum) { 4 if (!r...
分类:
其他好文 时间:
2015-07-12 00:05:25
阅读次数:
167
原文链接:http://blog.csdn.net/smartgps2008/article/details/7741223不带标题栏的窗口最大化:第一种情况:覆盖任务栏ShowWindow(SW_SHOWMAXIMIZED);第二种情况:不覆盖任务栏int cx = GetSystemMetric...
分类:
编程语言 时间:
2015-07-12 00:02:03
阅读次数:
146