足彩复式投注的中奖匹配问题 如何将足彩的复式投注进行中奖匹配,如将复式投注310,310,310,1,1,0,0,3,1,10,10,30,30,1跟中奖号码3,1,1,1,1,0,0,3,1,1,1,3,0,1进行匹配,算出其中的一二三等奖的个数目前想到的思路是先将复式投注转换为单式投注,但是,这个转换的算法,还没找到!希望能得到高人的指点! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 #include <stdio.h>#include <string.h>#include <stdlib.h>char str[] = "310,310,310,1,1,0,0,3,1,10,10,30,30,1";char strResult[255] = {0};int n = 0;void Test(const char *pStr, int num){ int len = 0; char *p = strstr(pStr, ","); if (p != NULL) { // Find ',' len = p - pStr; } else { // The last numbers len = strlen(pStr); } for (int i=0; i<len; i++) { strResult[num] = pStr[i]; // Print the string you need if (NULL == p) { printf("Result:%d \t %s\n", ++n, strResult); system("pause"); } else { Test(p + 1, num + 1); } } num++;}int main(){ Test(str, 0); return 0;} 关于GDI+按钮的问题 Vista Session0 和Session1问题 关于进程间通讯 请问,有哪个变量标识打开的文档有没有改动过???? 哪位能提供windows网络编程这本书! 怎么样解析域名的ip地址呢? 请问通过响应哪个Window消息能知道窗口隐藏(ShowWindow(SW_HIDE))或显示(ShowWindow(SW_SHOW))? 数据库联结的问题 接收函数识别的程序算法? 求助:mssql,mysql,orecal,各种版本连接字符串问题 怎么在frame里固定位置画图方便?? 200分,RichEditView下自动滚动视图的问题!
#include <string.h>
#include <stdlib.h>char str[] = "310,310,310,1,1,0,0,3,1,10,10,30,30,1";char strResult[255] = {0};int n = 0;void Test(const char *pStr, int num)
{
int len = 0; char *p = strstr(pStr, ",");
if (p != NULL) { // Find ','
len = p - pStr;
}
else { // The last numbers
len = strlen(pStr);
} for (int i=0; i<len; i++) { strResult[num] = pStr[i]; // Print the string you need
if (NULL == p) {
printf("Result:%d \t %s\n", ++n, strResult);
system("pause");
}
else {
Test(p + 1, num + 1);
}
}
num++;
}int main()
{
Test(str, 0); return 0;
}