63,594
社区成员




TCHAR strResult[MAX_PATH];
LPCTSTR str = =_T("keywordtype=&keyword%s&jobarea=%s&stype=2&image.x=35&image.y=15");
TCHAR *m, *n;
_sntprintf(strResult, sizeof( strResult) / sizeof( TCHAR ), str, m, n);
#include "iostream"
using namespace std;
int main()
{
char* fmt = "hello world %d, hi how areyou %d";
char str[128];
for (int i = 0; i < 20; ++i)
for (int j = 100; j < 200; ++j)
{
sprintf(str, fmt, i, j);
cout<<str<<endl;
}
return 0;
}
TCHAR strResult[MAX_PATH];
LPCTSTR str = =_T("keywordtype=&keyword%s&jobarea=%s&stype=2&image.x=35&image.y=15");
TCHAR *m, *n;
_sntprintf(strResult, sizeof( strXmlRequest ) / sizeof( TCHAR ), str, m, n);
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
#define M 3
#define N 5
int main(int argc, char* argv[])
{
string m[M] = {"上海","台湾","广州"};
int n[N] = {1,2,3,4,5};
for(int i = 0;i<M;i++)
{
for(int j = 0;j<N;j++)
{
ostringstream oss;
oss<<"keywordtype=&keyword"<<m[i]<<"&jobarea="<<n[j]<<"&stype=2&image.x=35&image.y=15";
string result = oss.str();
cout<<result<<endl;
}
}
return 0;
}