码迷,mamicode.com
首页 >  
搜索关键字:c char c++ string    ( 126199个结果
字符数组在C++、C#等语言中的操作
1,C++中操作数组 #include using namespace std; int length(char []); void output_frequency(char []); int main() { char str[]="yan cong min"; cout<<"要处理的字符串为:"<<str<<endl; cout<<"字符串长度为:"<<lengt...
分类:编程语言   时间:2014-05-05 13:29:30    阅读次数:432
POJ-1011-Sticks
题目链接:http://poj.org/problem?id=1011 这道题用到了深搜+剪枝。 #include #include #include using namespace std; int a[65]; int vis[65]; int n; int cmp(int x,int y) { return x>y; } int dfs(int len,int need,int ...
分类:其他好文   时间:2014-05-05 13:28:57    阅读次数:290
浅谈c语言typedef 与结构体指针(个人小经验)
?? #include #include typedef struct emp{  char sex[8];  char name[15];  int age; }*emp;//这里我们用typedef把emp这个结构体变成了*emp这种指向结构体成员的结构体指针 /*typedef struct emp{  char sex[8];  char name[15];  int...
分类:编程语言   时间:2014-05-05 12:54:29    阅读次数:277
结合正则表达式验证数学公式(含变量,js版)
今天有朋友让我帮他写一个正则表达式,要求能验证一个数学公式格式是否正确。 数学公式中有括号,变量(未知数)和运算符,而且变量是重数据库中读取的,可以任意添加和删除。 这个用一个正则表达式实现是不可能的,所以我给他写了一个函数,如下:...
分类:Web程序   时间:2014-05-04 12:46:33    阅读次数:1238
写了一个二叉树构造及中序遍历函数
// BTree.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include"stdlib.h" #include"malloc.h" #define BT BTreeNode #define MS 10 typedef struct BT{ char data; struct BT *left; struct BT *right; }BT; ...
分类:其他好文   时间:2014-05-04 12:45:34    阅读次数:365
Cocos2d-x3.0 文件处理
1、从文件中读取内容 auto sharedFileUtils = FileUtils::getInstance(); std::string ret; sharedFileUtils->purgeCachedEntries(); std::vector searchPaths = sharedFileUtils->getSearchPath...
分类:其他好文   时间:2014-05-04 00:09:23    阅读次数:408
Java和C#输入输出流方法
1,JAVA中操作方法: import java.io.*; public class FileInputStreamTest { public static void main(String[] args) throws IOException { //创建字节输入流 FileInputStream fis = new F...
分类:编程语言   时间:2014-05-03 16:48:43    阅读次数:332
fzu-1894 志愿者选拔-单调队列
转战单调队列,争取省赛前做完。。。。 这个题是很裸的单调队列。 不能用stl让人很蛋疼。。。。 就是用一个队列保存当前队伍的信息,如果来了一个大的,就把前面的小的挤掉。 #include #include #include #include #include #include using namespace std; #define maxn 55000 #define INF 99999...
分类:其他好文   时间:2014-05-03 16:28:35    阅读次数:342
Cocos2d3.0 制作PList文件
auto root = Dictionary::create(); auto string = String::create("string element value"); root->setObject(string, "string element key"); auto array = Array::create(); ...
分类:其他好文   时间:2014-05-03 16:27:48    阅读次数:380
codeforces A. k-String 题解
本题有意思,是hash表的灵活运用。 思路: 1 计算好总字符数,和使用hash表A[26]记录好各个字符出现的次数 2 判断总字符是否可以被k整除,如果不可以,那么就不能分成k个子字符了 3 计算各个字符出现的次数是否能被k整除,如果不能,那么就不能分成k个子字符 4 根据字符出现的次数逐个打印...
分类:其他好文   时间:2014-05-03 15:43:20    阅读次数:394
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!