锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
Time Limit:1000MS Memory Limit:32768K
1 2 3 3 8 10 100 210 7 900 1 0 0銆0銆0
yes no no yes
================================================================================
鎻愪氦娌掓湁鎴愬姛
#include <cstdlib>
#include <iostream>
using namespace std;
#define MAX_ROW 50
string out[MAX_ROW];
int num[MAX_ROW][3];
int index=0;
void output()

{
for(int i=0;i<index;++i)
{
cout<<out[i].c_str();
cout<<endl;
}
}
bool dfs(float number,int n)

{
if(n>=3)
return number==0;
if(dfs(number+num[index][n],n+1)) return true;
if(dfs(number-num[index][n],n+1)) return true;
if(dfs(number*num[index][n],n+1)) return true;
if(dfs(number/num[index][n],n+1)) return true;
return false;
}
int main(int argc, char *argv[])

{
while(1)
{
for(int i=0;i<3;++i)
cin>>num[index][i];
if(num[index][0]==0&&
num[index][1]==0&&
num[index][2]==0)
{
break;
}
if(dfs(num[index][0],1)) out[index]="yes";
else out[index]="no";
index++;
}
output();
system("PAUSE");
return 0;
}
string Mystring1;
string Mystring2(" hello world!");
string Mystring1=Mystring2; //Mystring1鍜孧ystring2鎸囧悜鍚屼竴涓瓧絎︿覆
string Mystring3(Mystring2.c_str());//緇橫ystring3閲嶆柊鍒嗛厤
2.瀛楃涓插嚱鏁?br> 1) empty() 鍒ゆ柇瀛楃涓蹭負絀?br> 2) length()鍜宻ize() 瀛楃涓查暱搴?length()鏄痗++鏍囧噯,size()鏄疭TL鎻愪緵鐨?
3) append() 娣誨姞鎴愬憳
4) find(),find_first_not_of(),find_first_of(),find_last_not_of(),find_last_of(),rfind()
find()鍑芥暟鐨勫姛鑳芥槸浠巗td::string瀵硅薄鐨勫ご閮ㄩ『搴忔壘鐩爣鍊鹼紝濡傛灉鎵懼埌榪斿洖璇ョ洰鏍囩殑浣嶇疆錛屽鏋滄病鏈夊瓧絎︿覆瀵硅薄涓壘鍒扮洰鏍囧璞★紝榪斿洖-1.
銆銆rfind()璺焒ind()鐩鎬技鍙槸浠巗tring瀵硅薄鐨勫悗閮ㄥ悜鍓嶆煡鎵撅紟
find_first_not_of() 璇ュ嚱鏁扮殑鍔熻兘鏄湪string瀵硅薄涓煡鎵懼璞★紝濡傛灉鍦╯tring鍑虹幇浜嗗畬鍏ㄤ笉鍖歸厤鐨勫瓧絎︼紝瀛楃涓叉垨浠ョ┖瀛楃緇撳熬鐨勫瓧絎︽暟緇勬椂錛岀郴緇熸樉紺虹涓嬈″嚭鐜拌繖縐嶆儏褰㈢殑浣嶇疆錛庛銆銆銆
#include "stdafx.h" 
int EnableDebugPriv(const char * name) 

{
HANDLE hToken;
TOKEN_PRIVILEGES tp;
LUID luid;
//鎵撳紑榪涚▼浠ょ墝鐜?nbsp;
OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,
&hToken);
//鑾峰緱榪涚▼鏈湴鍞竴ID
LookupPrivilegeValue(NULL,name,&luid)
tp.PrivilegeCount = 1;
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
tp.Privileges[0].Luid = luid;
//璋冩暣鏉冮檺
AdjustTokenPrivileges(hToken,0,&tp,sizeof(TOKEN_PRIVILEGES),NULL,NULL);
return 0;
} 
BOOL InjectDll(const char *DllFullPath, const DWORD dwRemoteProcessId) 

{
HANDLE hRemoteProcess;
EnableDebugPriv(SE_DEBUG_NAME)
//鎵撳紑榪滅▼綰跨▼
hRemoteProcess = OpenProcess( PROCESS_CREATE_THREAD | //鍏佽榪滅▼鍒涘緩綰跨▼PROCESS_VM_OPERATION | //鍏佽榪滅▼VM鎿嶄綔
PROCESS_VM_WRITE,//鍏佽榪滅▼VM鍐?nbsp;
FALSE, dwRemoteProcessId );
char *pszLibFileRemote;
//浣跨敤VirtualAllocEx鍑芥暟鍦ㄨ繙紼嬭繘紼嬬殑鍐呭瓨鍦板潃絀洪棿鍒嗛厤DLL鏂囦歡鍚嶇┖闂?nbsp;
pszLibFileRemote = (char *) VirtualAllocEx( hRemoteProcess, NULL, lstrlen(DllFullPath)+1,
MEM_COMMIT, PAGE_READWRITE);
//浣跨敤WriteProcessMemory鍑芥暟灝咲LL鐨勮礬寰勫悕鍐欏叆鍒拌繙紼嬭繘紼嬬殑鍐呭瓨絀洪棿
WriteProcessMemory(hRemoteProcess,
pszLibFileRemote, (void *) DllFullPath, lstrlen(DllFullPath)+1, NULL)錛?nbsp;
//璁$畻LoadLibraryA鐨勫叆鍙e湴鍧
PTHREAD_START_ROUTINE pfnStartAddr = (PTHREAD_START_ROUTINE)
GetProcAddress(GetModuleHandle(TEXT("Kernel32")), "LoadLibraryA"); 
//鍚姩榪滅▼綰跨▼LoadLibraryA錛岄氳繃榪滅▼綰跨▼璋冪敤鍒涘緩鏂扮殑綰跨▼
HANDLE hRemoteThread;
if( (hRemoteThread = CreateRemoteThread( hRemoteProcess, NULL, 0, pfnStartAddr, pszLibFileRemote, 0, NULL) ) == NULL) 
{
printf("CreateRemoteThread error!\n");
return FALSE;
} 
return TRUE;
} 
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow) 

{
InjectDll("c:\zrqfzr.dll",3060) //榪欎釜鏁板瓧鏄綘鎯蟲敞鍏ョ殑榪涚▼鐨処D鍙?nbsp;
return 0;
}
#include <list>
#include <string>
#include <iostream.h>
#include <algorithm> //for_each()
using namespace std;

void PrintIt(string &strPrint)
{
cout<<strPrint<<endl;
}
int _tmain(int argc, _TCHAR* argv[])

{
list<string> aa;
char a;
aa.push_back("aaaaaaa");
aa.push_back("ccccccc");
cout<<aa.size()<<endl;
list<string>::iterator aaiterator;
for(aaiterator=aa.begin();aaiterator!=aa.end();aaiterator++)
{
cout<<*aaiterator<<endl;
}
cin>>a;

cout<<"鏂規硶浜岋細"<<endl;
for_each(aa.begin(),aa.end(),PrintIt);
return 0;
}


