HW
文章平均质量分 77
gavinnotkavin
。。。。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
24点游戏算法
给4个1到10的数,然后这4个数能否经过加减乘除后得到24枚举所有组合即可首先枚举4个数字的排列,然后对于每一个排列,枚举运算符#include #include "OJ.h" #include #include #include using namespace std; bool dfs(int nums[], int index, int sum) { if(index >=原创 2016-03-02 23:42:30 · 1154 阅读 · 0 评论 -
IP地址判断有效性
判断输入的字符串是否为合法IP 合法IP即为*.*.*.*形式,不允许出现前置0,之间不能有空格,每一段的数字在0-255之间,字符串前后允许有空格 #include #include "OJ.h" #include #include #include using namespace std; bool isIPAddressValid(const char* pszIPAddr) {原创 2016-03-04 23:37:35 · 1866 阅读 · 0 评论
分享