// Home.cpp : 定义控制台应用程序的入口点。
//
#include <stdio.h>
#include "stdafx.h"
#include "string.h"
//#include "stdlib.h"
int GetBit(int n)
{
int bitcount = 1;
while(n >10)
{
bitcount++;
n = n/10;
}
return bitcount;
}
char *GetStr(int m,int n)
{
char str[100] = {'\0'};
int strcount = 0;
for (int i=m;i<=n;i++)
{
int newcharnum = GetBit(i);
char *tempstr = new char[newcharnum];
sprintf(tempstr,"%d",i);
if (n == i)
{
strcat(tempstr,";");
}
else
{
strcat(tempstr,"+");
}
strcat(str,tempstr);
//str[strcount] =
int kkk =0;
}
return str;
}
int _tmain(int argc, _TCHAR* argv[])
{
char str[100] = {'\0'};
char *strindex = GetStr(11,19);
strcpy(str,strindex);
return 0;
}
//
#include <stdio.h>
#include "stdafx.h"
#include "string.h"
//#include "stdlib.h"
int GetBit(int n)
{
int bitcount = 1;
while(n >10)
{
bitcount++;
n = n/10;
}
return bitcount;
}
char *GetStr(int m,int n)
{
char str[100] = {'\0'};
int strcount = 0;
for (int i=m;i<=n;i++)
{
int newcharnum = GetBit(i);
char *tempstr = new char[newcharnum];
sprintf(tempstr,"%d",i);
if (n == i)
{
strcat(tempstr,";");
}
else
{
strcat(tempstr,"+");
}
strcat(str,tempstr);
//str[strcount] =
int kkk =0;
}
return str;
}
int _tmain(int argc, _TCHAR* argv[])
{
char str[100] = {'\0'};
char *strindex = GetStr(11,19);
strcpy(str,strindex);
return 0;
}