锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
鎴戠殑QQ錛?0858492
email錛?a href="mailto:wzqxp2002@163.com">wzqxp2002@163.com
]]>
鑰楁椂錛?031 CLOCKS_PER_SEC 錛堟湭杈撳嚭錛?/strong>
#include <vector>
#include <algorithm>
#include <iostream>
#include<ctime>
using namespace std;
void GenerateCandidate(int n, vector<int>& Candidate, vector<int>& Filter)
{
int base = 1;
for (int i=1; i<n; ++i)
{
base *= 10;
}
int baseUp = base*10;
int remainder = base % n;
if (remainder != 0)
{
int quotient = base / n;
base = (quotient+1)*n;
}
int number = base;
do
{
int numberTest = number/10;
if(binary_search(Filter.begin(), Filter.end(), numberTest))
{
Candidate.push_back(number);
}
number += n;
} while(number < baseUp);
}
void InitFilter(vector<int>& Filter)
{
for (int i=1; i<10; ++i)
{
Filter.push_back(i);
}
}
int _tmain(int argc, _TCHAR* argv[])
{
vector<int> candidate;
vector<int> filter;
InitFilter(filter);
//candidate.reserve(100000000);
//filter.reserve(100000000);
for (int i=2; i<9; ++i)
{
GenerateCandidate(i, candidate, filter);
//copy(candidate.begin(), candidate.end(), ostream_iterator<int>(cout, "\n"));
filter.clear();
candidate.swap(filter);
}
candidate.swap(filter);
//copy(candidate.begin(), candidate.end(), ostream_iterator<int>(cout, " "));
cout<<endl <<"count:" <<candidate.size();
cout<<endl <<"time:"<<clock();
char c;
cin>>c;
return 0;
}
#include <iostream>
#include<ctime>
using namespace std;
int count =0;
void FindNumber(int base, int power, int end)
{
int bounce = base+9;
int remainder = base%power;
if (0 != remainder)
{
remainder = power - remainder;
}
base += remainder;
do
{
if (power == end)
{
//cout << base <<" ";
count++;
}
else if(base != 0)
{
FindNumber(base*10, power+1, end);
}
base += power;
} while(base<=bounce);
}
void FindNumber(int end)
{
FindNumber(0, 1, end);
}
int _tmain(int argc, _TCHAR* argv[])
{
FindNumber(9);
cout<<endl<<count;
cout<<endl <<"time:"<<clock();
char c;
cin>>c;
return 0;
}
#include <iostream>
using namespace std;
bool StringToInt(char* str, int& Digite)
{
if (str == NULL || *str == '\0')
{
return false;
}
char* pChar = str;
Digite = 0;
for(; *pChar!='\0';++pChar)
{
Digite *= 10;
if (*pChar < '0' || *pChar > '9')
{
return false;
}
Digite += *pChar - '0';
}
return true;
}
int _tmain(int argc, _TCHAR* argv[])
{
int iResult;
StringToInt("342566", iResult);
cout << iResult;
cin >>iResult;
return 0;
}
This position is for an entry/intermediate software developer.
Requirements:
This position is for a lead software developer.
Requirements:
鏈夋剰鑰呰灝嗙畝鍘嗗彂閫佽嚦錛?a href="mailto:Zhenquan.Wang@autodesk.com">Zhenquan.Wang@autodesk.com, 鎴戝皢閫夋嫨鍚堥傜殑綆鍘嗘帹鑽愩?/span>
int
聽(tīng)main()
{
聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
int
聽(tīng)a聽(tīng)
=
聽(tīng)
-
1
;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
char
聽(tīng)b聽(tīng)
=
聽(tīng)
-
1
;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
do
聽(tīng)
{
聽(tīng)cout聽(tīng)
<<
聽(tīng)
"
please聽(tīng)input聽(tīng)the聽(tīng)a聽(tīng)and聽(tīng)b
"
;
聽(tīng)cin聽(tīng)
>>
聽(tīng)a;聽(tīng)
聽(tīng)
if
聽(tīng)(cin.fail())
聽(tīng)
{
聽(tīng)聽(tīng)cin.clear();
聽(tīng)聽(tīng)cin.rdbuf()
->
pubseekpos(cin.rdbuf()
->
in_avail());
聽(tīng)}
聽(tīng)cin聽(tīng)
>>
聽(tīng)b;
聽(tīng)
if
聽(tīng)(cin.fail())
聽(tīng)
{
聽(tīng)聽(tīng)cin.clear();
聽(tīng)聽(tīng)cin.rdbuf()
->
pubseekpos(cin.rdbuf()
->
in_avail());
聽(tīng)}
聽(tīng)}
聽(tīng)
while
(a聽(tīng)
<
聽(tīng)
0
聽(tīng)
||
聽(tīng)b聽(tīng)
<
聽(tīng)
0
);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)
return
聽(tīng)
0
;
}
聽(tīng)