附网址:http://qt-project.org/doc/qt-5/qtquick-usecase-integratingjs.html
Use Case - Integrating JavaScript in QML
—— 在QML中集成JavaScript代码
JavaScript代码可以很容易被集成到QML中以提供UI逻辑,必要的控制,或是其他益处。
Using J...
分类:
编程语言 时间:
2014-06-19 12:31:55
阅读次数:
242
POJ1258
思路:首先把第一个结点加入树中,每次往树中加入一个结点,加入的结点必须是与当前树中的结点距离最小那个点,这样每次把结点加入树中选取的都是最小权值,循环n-1次后把所有结点都加入树中。
#include
#include
#include
using namespace std;
const int MAXN = 1e9;
//创建map二维数组储存图表,low数组记录每2个点...
分类:
其他好文 时间:
2014-06-19 09:54:24
阅读次数:
255
题目:给你一些01串,判断是不是某些串是其它串的前缀。
分析:字符串,字典树。
首先,将字符串按长度排序,这样前缀一定在前面;
然后,再插入字典树的过程中,判断是否覆盖即可。
说明:注意数组的大小。
#include
#include
#include
#include
using namespace std;
char wor...
分类:
其他好文 时间:
2014-06-15 20:09:54
阅读次数:
190
#include
#include
using std::cout;
using std::endl;
using std::cin;
using std::string;
int main(void){
string str1="We can insert a string";
string str2="a str into ";
//在字符串指定位置...
分类:
编程语言 时间:
2014-06-15 19:29:30
阅读次数:
251
题目大意:
问A-B 走K 部的方法数。
如果矩阵 a 为任意一个点到另外一个点 走 1 步的方法数
那么 a*a 就是任意一个点到另外一个点 走 2 步的方法数
。。。
那么直接快速幂。
#include
#include
#include
#include
#include
#define N 10
using namespace std;
in...
分类:
其他好文 时间:
2014-06-15 18:02:55
阅读次数:
212
题目:再一句话里面有P,I,U中的2个已知量,求第三个未知量。(P=I*U)
分析:字符串。利用'='定位已知量,然后将'='后面的的数字和单位分别读入处理。
说明:注意单位有m(10^-3),k(10^3),M(10^6)的前缀,以及小数点的处理。
#include
#include
#include
#include
using namespace std;
char Sat...
分类:
其他好文 时间:
2014-06-15 17:48:02
阅读次数:
199
程序代码:
#include
using namespace std;
class CTime//时间类
{
private:
unsigned short int hour; //时
unsigned short int minute; //分
unsigned short int second; //秒
public:
CTime(int h=0,int m=0,i...
分类:
其他好文 时间:
2014-06-15 16:29:40
阅读次数:
351
示例中有详细注释,直接上代码:
#include
#include
using std::cout;
using std::endl;
using std::string;
int main(void){
string str1="hi,test,hello";
string str2="test";
//搜索子串,返回子串第一个字符的索引
cout << st...
分类:
编程语言 时间:
2014-06-15 16:19:55
阅读次数:
233
题目:给你一些单词和一个字母矩阵,问这个单词最早出现在哪里(单词可以向8个直线方向书写)。
分析:字符串。枚举矩阵中每个字母的8个方向,生成最长字符,然后在里面找单词即可。
说明:处理前,将大写字母先转化成小写字母。
#include
#include
#include
#include
using namespace std;
char text[52][52];
char w...
分类:
其他好文 时间:
2014-06-15 09:33:33
阅读次数:
164
compare函数用来进行字符串以及其子串的比较,示例如下:
#include
#include
#include
using std::cout;
using std::endl;
using std::cin;
using std::string;
int main(void){
const int maxlength=100;
string str1="hi,t...
分类:
编程语言 时间:
2014-06-15 08:52:26
阅读次数:
287