锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品女人天堂AV麻,色悠久久久久久久综合网,欧美色综合久久久久久http://www.shnenglu.com/gohan/category/937.htmlzh-cnThu, 07 Aug 2008 08:50:38 GMTThu, 07 Aug 2008 08:50:38 GMT60灞變紡鏈[1]http://www.shnenglu.com/gohan/archive/2008/08/07/58197.htmlGohanGohanWed, 06 Aug 2008 18:30:00 GMThttp://www.shnenglu.com/gohan/archive/2008/08/07/58197.htmlhttp://www.shnenglu.com/gohan/comments/58197.htmlhttp://www.shnenglu.com/gohan/archive/2008/08/07/58197.html#Feedback3http://www.shnenglu.com/gohan/comments/commentRss/58197.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/58197.html闃呰鍏ㄦ枃

Gohan 2008-08-07 02:30 鍙戣〃璇勮
]]>
Win32鍛戒護琛屽簲鐢紝ReadConsoleInput()寰楀埌閿洏VK_CODEhttp://www.shnenglu.com/gohan/archive/2008/05/23/50817.htmlGohanGohanThu, 22 May 2008 16:08:00 GMThttp://www.shnenglu.com/gohan/archive/2008/05/23/50817.htmlhttp://www.shnenglu.com/gohan/comments/50817.htmlhttp://www.shnenglu.com/gohan/archive/2008/05/23/50817.html#Feedback5http://www.shnenglu.com/gohan/comments/commentRss/50817.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/50817.htmlimage

    ReadConsoleInput鏄竴涓猈in32 API錛?nbsp; 澹版槑濡備笅錛?/p>

BOOL ReadConsoleInput(
  HANDLE hConsoleInput, //杈撳叆鍙ユ焺
  PINPUT_RECORD lpBuffer, //鎸囧悜INPUT_RECORD緇撴瀯浣?鏁扮粍)鐨勬寚閽?/span>
  DWORD nLength, //涓婇潰閭d釜緇撴瀯浣撶殑澶у皬
  LPDWORD lpNumberOfEventsRead //瀹為檯璇誨叆杈撳叆鍐呭鐨勪釜鏁?/span>
);

    鎴戞妸璇誨叆鐨勫姛鑳藉啓鍦ㄨ繖涓姪鎵嬬被涓紝ReadConsoleInput鐨勫緱鍒癡K_CODE鐨勬柟娉曞彲浠ョ湅ReadKeyDown鍜孯eadKeyPush涓や釜鍑芥暟錛屽畠浠殑鏁堟灉鐣ユ湁鐐逛笉鍚屻傚彸鍥炬槸鏁堟灉鎴浘錛屾寜ESC璺沖嚭寰幆銆傚姪鎵嬬被浠ュ悗榪樺彲浠ユ坊鍔犻鑹叉帶鍒朵綅緗帶鍒剁瓑鍔熻兘錛屽彧瑕佷綘鎯籌紝鐩殑灝辨槸涓轟簡綆鍖朅PI璋冪敤銆?/p>

#pragma once
#include <Windows.h>
class GohanConsoleHelper
{
    HANDLE _hIn;
    HANDLE _hOut;
    INPUT_RECORD _InRec;
    DWORD _NumRead;
public:
    WORD VKey;
    GohanConsoleHelper(void){
        _hIn = GetStdHandle(STD_INPUT_HANDLE);
        _hOut = GetStdHandle(STD_OUTPUT_HANDLE);
        VKey=0;
    }
    bool ReadOneInput()
    {
        return 0!=ReadConsoleInput(_hIn,&_InRec,1,&_NumRead);
    }
    bool ReadOneInput(INPUT_RECORD& InRec)
    {
        return 0!=ReadConsoleInput(_hIn,&InRec,1,&_NumRead);
    }
    DWORD ReadKeyDown()
    {
        if(!ReadConsoleInput(_hIn,&_InRec,1,&_NumRead))
            return 0;
        if(_InRec.EventType!=KEY_EVENT)
            return 0;
        if(_InRec.Event.KeyEvent.bKeyDown > 0)
            return 0;
        VKey = _InRec.Event.KeyEvent.wVirtualKeyCode;
        return VKey;
    }
    DWORD ReadKeyPush()
    {
        if(!ReadConsoleInput(_hIn,&_InRec,1,&_NumRead))
            return 0;
        if(_InRec.EventType!=KEY_EVENT)
            return 0;
        if(_InRec.Event.KeyEvent.bKeyDown == 0)
            return 0;
        VKey = _InRec.Event.KeyEvent.wVirtualKeyCode;
        return VKey;
    }
public:
    ~GohanConsoleHelper(void){}
};
 
 

 

main鎵鍦ㄦ枃浠跺唴瀹?/p>

#include <windows.h>
#include <iostream>
#include "GohanConsoleHelper.h"
using namespace std;
int main()
{
    GohanConsoleHelper gch;
    while (true)
    {
        if(gch.ReadKeyPush()!=0) //浣跨敤ReadKeyDown()鎹曡幏鎸夐敭寮硅搗鐨刅K_CODE
        {
            if(gch.VKey != VK_ESCAPE)
                cout<<"VK_CODE == "<<gch.VKey<<endl;
            else {
                cout<<"Bye~~"<<endl;
                break;
            }
        }
    }
    return 0;
}

 

    鍦ㄥ懡浠よ寰楀埌VK_CODE鍙互騫茶澶氫簨鎯呬簡錛屽彲浠ュ啓涓湪Win32鍛戒護琛屼笅鐨勫皬娓告垙錛屼縿緗楁柉鏂瑰潡鍟婁粈涔堢殑錛屽懙鍛碉紝涓嶈繃鐢婚潰紼嶅井濂界偣鐨勫氨鎼炰笉浜嗕簡錛屽洜涓烘瘯绔焪in32鍛戒護琛屽垎杈ㄧ巼澶綆浜嗐?/p>

   蹇樹簡鏀懼嚭鍙傝冪殑璧勬枡錛?/p>

http://adrianxw.dk/ 姣旇緝鍏ㄩ潰鐨刉in32鍛戒護琛屾暀紼?/p>

Gohan 2008-05-23 00:08 鍙戣〃璇勮
]]>
鑾峰彇緇欏畾璺緞鐨勫浘鏍囷紝婕旂ずSHGetFileInfo鐢ㄦ硶http://www.shnenglu.com/gohan/archive/2008/05/02/48617.htmlGohanGohanThu, 01 May 2008 20:54:00 GMThttp://www.shnenglu.com/gohan/archive/2008/05/02/48617.htmlhttp://www.shnenglu.com/gohan/comments/48617.htmlhttp://www.shnenglu.com/gohan/archive/2008/05/02/48617.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/48617.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/48617.html鍩轟簬涓婃閭d釜SHBrowseForFolder鐢ㄦ硶鐨勬紨紺轟唬鐮?/font>
寤虹珛鐨勪粛鐒舵槸Win32 鍛戒護琛岀殑宸ョ▼錛屾墍浠ュ叆鍙g偣涓簃ain(),闇瑕佹墜鍔ㄨ幏鍙朒INSTANCE緇撴瀯銆傜▼搴忓湪WINXP+VS2005嫻嬭瘯閫氳繃image
/********************************************************************
  created:  2008/05/02
  created:  2:5:2008   3:40
            main.cpp
  author:    Gohan
  purpose:  婕旂ずSHBrowseForFolder鐢ㄦ硶
            婕旂ずSHGetFileInfo鑾峰彇璺緞鍥炬爣   
            婕旂ずPicture Box鍦⊿DK閲岀殑浣跨敤鏂規硶
*********************************************************************/
#include <Windows.h>
#include <ShlObj.h>
#include "resource.h"
HICON g_icon;
RECT g_rect;
TCHAR g_path[MAX_PATH];
void OnInitDlg(HWND hwnd)
{
   
GetWindowRect(GetDlgItem(hwnd, IDC_ICON1), &g_rect);
   
MapWindowPoints(NULL, hwnd, (LPPOINT) &g_rect, 2);
   
DestroyWindow(GetDlgItem(hwnd, IDC_ICON1));
   
SetDlgItemText(hwnd,IDC_PATH,g_path);
}
void OnPaint(HWND hwnd)
{
   
PAINTSTRUCT ps;
   
HDC hdc = BeginPaint(hwnd, &ps);
   
DrawIcon(hdc,g_rect.left,g_rect.left,g_icon);
   
EndPaint(hwnd,&ps);
}
BOOL CALLBACK DlgProc (HWND hDlg, UINT message,
                           
WPARAM wParam, LPARAM lParam)
{
   
switch (message)
    {
   
case WM_INITDIALOG :
       
OnInitDlg(hDlg);
       
return TRUE ;
   
case WM_PAINT:
       
OnPaint(hDlg);
       
return TRUE;
   
case WM_COMMAND :
       
switch (LOWORD (wParam))
        {
       
case IDOK :
       
case IDCANCEL :
           
EndDialog (hDlg, 0) ;
           
return TRUE ;
        }
       
break ;
    }
   
return FALSE ;
}
int main()
{
   
HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);
   
BROWSEINFO bi;
   
ZeroMemory(&bi,sizeof(BROWSEINFO));
   
LPMALLOC pMalloc;
   
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
   
   
if(pidl != NULL)
    {
       
SHGetPathFromIDList(pidl,g_path);
       
SHFILEINFO sfi;
       
ZeroMemory(&sfi,sizeof(SHFILEINFO));
       
SHGetFileInfo(g_path,0,&sfi,sizeof(SHFILEINFO),SHGFI_ICON);
       
g_icon = sfi.hIcon;
       
DialogBox (hInstance, MAKEINTRESOURCE(IDD_DIALOG1), 0, DlgProc) ;
       
//MessageBox(NULL,path,TEXT("Choose"),MB_OK);
        if(SUCCEEDED(SHGetMalloc(&pMalloc)))
        {
           
pMalloc->Free(pidl);
           
pMalloc->Release();
        }
    }
   
else
    {
       
MessageBox(NULL,TEXT("),TEXT("Choose"),MB_OK);
    }
}
/************************************************************************/
/* resource.h                                                           */
/************************************************************************/
#define IDD_DIALOG1                     101
#define IDC_PATH                        1001
#define IDC_ICON1                       1002
/************************************************************************/
/* demo.rc Microsoft Visual C++ generated resource script.              */
/************************************************************************/
#include "resource.h"
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_DIALOG1 DIALOGEX 0, 0, 126, 83
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP
FONT
8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "紜畾",IDOK,69,7,50,14
   
PUSHBUTTON      "鍙栨秷",IDCANCEL,69,24,50,14
   
CONTROL         "",IDC_ICON1,"Static",SS_WHITEFRAME | SS_REALSIZEIMAGE,13,10,20,20,WS_EX_TRANSPARENT
    LTEXT           "闈欐?,IDC_PATH,14,44,89,21,0,WS_EX_CLIENTEDGE
END


/////////////////////////////////////////////////////////////////////////////


Gohan 2008-05-02 04:54 鍙戣〃璇勮
]]>
鍏充簬Up/Down鎺т歡錛坰pin control錛変嬌鐢ㄦ柟娉曠殑涓鐐瑰皬蹇冨緱http://www.shnenglu.com/gohan/archive/2008/02/06/42558.htmlGohanGohanTue, 05 Feb 2008 18:14:00 GMThttp://www.shnenglu.com/gohan/archive/2008/02/06/42558.htmlhttp://www.shnenglu.com/gohan/comments/42558.htmlhttp://www.shnenglu.com/gohan/archive/2008/02/06/42558.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/42558.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/42558.html image    瀛︾敤綰疭DK鍐檞in32紼嬪簭錛岃祫鏂欐湁涓涓?a target="_blank">鑻辨枃鐗圵indows Programming鐢靛瓙涔︼紝浠ュ強MSDN錛岀敤鍒頒簡Up/Down鎺т歡璁╃敤鎴瘋緭鍏ユ暟鎹紝鍚屾椂涔熸彁渚涗簡Edit box.涓よ呯殑鍚屾鏄惁浼氭湁闂鍛紵
  灝濊瘯浜嗗崐澶╋紝緇堜簬鏈変簡鐐圭粨鏋滐細
1銆佸垵濮嬪寲鎺т歡錛屽鎺т歡鍙ユ焺鍙戦?a target="_blank">UDM_SETRANGE32娑堟伅錛岃繘琛岃寖鍥寸殑鍒濆璇濄?a target="_blank">UDM_SETPOS32娑堟伅璁劇疆鍒濆箋?br>    image
2銆佸叧鑱擡dit Box 鎺т歡錛岃繖涓垜寮勪簡鍗婂ぉ鎵嶆槑鐧斤紝棣栧厛瑕佸湪璧勬簮緙栬緫涓殑瀵硅瘽妗嗙紪杈戠晫闈紝璁懼畾Tab鎺т歡鐨勯『搴忥紙鏍煎紡->Tab閿『搴忥級銆?font color="#ff0000">灝咵dit Box鐨勫簭鍙瘋緗垚Up/Down鎺т歡搴忓彿鍑忎竴錛岃瀹歎p/Down鐨勫睘鎬uto Buddy涓篢rue錛孲et Buddy Integer涓簍rue銆?br>3銆佺幇鍦ㄥ凡緇忚兘澶熸甯哥殑浣跨敤Up/Down鍔熻兘浜嗐?br>  鍙槸濡傛灉涓嶆兂鐢ㄦ帶浠跺叧鑱?/font>錛岃屾槸鑷繁璁懼畾閫昏緫鎬庝箞鍔炲憿錛熷嚑涓皬鏃朵箣鍓嶆垜涓嶄細鍏寵仈鐨勬柟娉曪紝鎯寵鍔姏瀹炵幇鎵嬪姩緇存姢Edit box鐨勫姛鑳姐傛渶鍚庣粓浜庢湁浜嗕簺鏁欒錛屽緱鍒頒簡鐐瑰績寰楋細
  鍦║p/Down鐨勭埗紿楀彛錛堜竴鑸槸瀵硅瘽妗嗭級鐨勬秷鎭鐞嗗嚱鏁頒腑錛屽WM_VSCROLL娑堟伅鍋氫竴涓鐞嗭紝褰搇Param涓嶶p/Down鐨勭獥鍙e彞鏌勭浉絳夋椂錛屽Up/Down鐨勬搷浣滅粨鏉?/font> 錛屽叾涓瓀Param涓殑楂樹綅閮ㄥ垎鏄疷p/Down鐨勫鹼紝鐢ㄨ繖涓兼潵鏇存柊Edit Box銆?br>WM_VSCROLL nScrollCode = (int)LOWORD(wParam);
  nPos = (short int)HIWORD(wParam);
  hwndScrollBar = (HWND) lParam;

  浠婂ぉ鎴戠殑鏁欒鏄嬌鐢ㄤ簡WM_NOTIFY鐨勬秷鎭紝澶勭悊UDN_DELTAPOS鐨勯氱煡錛宭Param鏄竴涓粨鏋勶細NMUPDOWN錛岄氳繃榪欎釜緇撴瀯鏉ユ洿鏂癊dit box錛屽洜涓鴻繖涓氱煡涓嶇瓑鎿嶄綔緇撴潫灝卞凡緇忓彂鍑猴紝騫朵笖榪欎釜緇撴瀯浣撲腑鏈夊綋鏃剁殑浣嶇疆浠ュ強鍙樺寲閲忥紝鏇存柊鏃跺欒繕闇瑕佸皢褰撴椂浣嶇疆鍔犱笂鍙樺寲閲忋傝繖鏍風殑鏇存柊灝變細鍑虹幇涓瀹氱殑闂錛屾湁鏃跺檖os宸茬粡鍒頒簡璁懼畾濂界殑鑼冨洿杈圭晫錛宲os鍔犱笂鍙樺寲閲忓氨浼氳秴鍑鴻竟鐣岋紝榪樿緇х畫鍒ゆ柇錛屾晥鐜囩瓑絳夐棶棰樺氨鍑虹幇浜嗭紝鑰屼笖鍗佸垎楹葷儲銆傛墍浠ユ渶濂戒嬌鐢ㄥ叧鑱旂殑鏂規硶錛屽鏋滄湁鐗規畩瑕佹眰灝辯敤WM_VSCROLL鍝嶅簲錛?font color="#ff0000">鍗冧竾涓嶈浣跨敤UDN_DELTAPOS錛岀櫧鑺卞姛澶?/font>錛屽懙鍛點傚氨鍐欏埌榪欓噷.

浠婂ぉ鏄櫎澶曚簡錛岀鎵鏈夌▼搴忓憳鏈嬪弸鏂版槬蹇箰錛侊紒



Gohan 2008-02-06 02:14 鍙戣〃璇勮
]]>
dd鐨凞P棰樼洰鍑虹殑鐪熺殑涓嶉敊http://www.shnenglu.com/gohan/archive/2007/11/09/36261.htmlGohanGohanFri, 09 Nov 2007 14:48:00 GMThttp://www.shnenglu.com/gohan/archive/2007/11/09/36261.htmlhttp://www.shnenglu.com/gohan/comments/36261.htmlhttp://www.shnenglu.com/gohan/archive/2007/11/09/36261.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/36261.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/36261.htmlbinary_search()閬囧埌鏌ヨ鍊艱秴鍑烘湁搴忔暟緇勮寖鍥寸殑鎯呭喌濂藉儚浼氳繑鍥瀟rue,鐪熺殑涓嶅簲璇ュ伔鎳掍貢鐢?涓涓暀璁?br>鍓╀笅鐨勫ソ濂藉鍚?

Gohan 2007-11-09 22:48 鍙戣〃璇勮
]]>
fontpipelinehttp://www.shnenglu.com/gohan/archive/2007/08/26/30874.htmlGohanGohanSun, 26 Aug 2007 12:27:00 GMThttp://www.shnenglu.com/gohan/archive/2007/08/26/30874.htmlhttp://www.shnenglu.com/gohan/comments/30874.htmlhttp://www.shnenglu.com/gohan/archive/2007/08/26/30874.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/30874.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/30874.htmlhaha, I just finished up my pong game and I ran into same problem (I hope the XNA team does work on making fonts better).

 If you load up the Sample Font's project and then select the \Content\TrueTypeFont.xml file and look at it's properties, you'll see the Content Importer and Content Processor's set.    In your project, you'll need to do the following:

  1. Right click on your project and select properties.
  2. Select the Content Pipeline
  3. Select Add
  4. Browse to your FontPipeline\bin\debug folder (or wherever you have the fontpipeline compiled)
  5. Select Open on the FontPipeline.dll.

Then on the properties of the TrueTypeFont.xml file in your project

  1. Set the XNA Framework Content to True.
  2. Set the Content Importer to XML Content - XNA Framework.
  3. Set the Content Processor to TrueTypeFontProcessor.

I did this by memory so just let me know if that doesn't do the trick and I'll dig through my project.

HTHs!

http://forums.xna.com/thread/4778.aspx

鍏充簬XML鏍煎紡鐨?strong>TrueTypeFont鐨勭枒闂氨榪欎箞瑙e喅浜?/strong>

Gohan 2007-08-26 20:27 鍙戣〃璇勮
]]>
zju1942瑙i鎶ュ憡http://www.shnenglu.com/gohan/archive/2007/07/28/28907.htmlGohanGohanSat, 28 Jul 2007 13:04:00 GMThttp://www.shnenglu.com/gohan/archive/2007/07/28/28907.htmlhttp://www.shnenglu.com/gohan/comments/28907.htmlhttp://www.shnenglu.com/gohan/archive/2007/07/28/28907.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/28907.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/28907.html闃呰鍏ㄦ枃

Gohan 2007-07-28 21:04 鍙戣〃璇勮
]]>
pku3297瑙i鎶ュ憡http://www.shnenglu.com/gohan/archive/2007/07/28/28898.htmlGohanGohanSat, 28 Jul 2007 08:37:00 GMThttp://www.shnenglu.com/gohan/archive/2007/07/28/28898.htmlhttp://www.shnenglu.com/gohan/comments/28898.htmlhttp://www.shnenglu.com/gohan/archive/2007/07/28/28898.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/28898.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/28898.html榪欓亾棰樻垜鐢ㄧ殑鏂規硶寰堥夯鐑?浣跨敤涓涓粨鏋勪綋vector淇濆瓨緇撴灉,浣跨敤涓涓猰ap鍒ゆ柇鏄笉鏄竴涓漢鎶ヤ簡涓や釜宸ョ▼.浣跨敤set鍒ゆ柇涓涓伐紼嬫槸涓嶆槸鏈変漢閲嶅鎶ュ悕
浜庢槸灝辨湁浜嗕笅闈㈢殑絎ㄦ嫏浠g爜

 1#include <string>
 2#include <set>
 3#include <vector>
 4#include <memory.h>
 5#include <map>
 6#include <algorithm>
 7using namespace std;
 8
 9struct Project
10{
11    string name;
12    int studentcount;
13    Project()
14    {
15        studentcount=0;
16        name.assign("");
17    }

18}
;
19
20map<string,int> studentmap;
21set<string> studentset;
22vector<Project> prov;
23int countarray[101]={0};
24char strtemp[100]="";
25Project project;
26
27inline bool comp(const Project &p1,const Project &p2)
28{
29    return p1.studentcount>p2.studentcount;
30}

31inline bool comp2(const Project &p1,const Project &p2)
32{
33    return p1.name.compare(p2.name)<0;
34}

35
36int main()
37{
38    
39    while(true)
40    {
41        int projcount=0;
42        prov.push_back(project);
43        while(true)
44        {
45            gets(strtemp);
46            project.name.assign(strtemp);
47            if(project.name[0]=='1')break;
48            if(project.name[0]=='0')exit(0);
49            if(project.name[0]>='A'&&project.name[0]<='Z')
50            {
51                prov.push_back(project);
52                studentset.clear();
53                projcount++;
54            }

55            if(project.name[0]>='a'&&project.name[0]<='z')
56            {
57                if(studentmap[strtemp]==0)
58                {
59                    studentmap[strtemp]=projcount;
60                }

61                else if(studentmap[strtemp]==-1)
62                {
63                    continue;
64                }

65                else if(studentmap[strtemp]!=projcount)
66                {
67                    prov[studentmap[strtemp]].studentcount--;
68                    studentmap[strtemp]=-1;
69                    continue;
70                }

71                if(studentset.count(strtemp))
72                    continue;
73                else
74                {
75                    studentset.insert(strtemp);
76                    prov[projcount].studentcount++;
77                }

78            }
                        
79        }

80        prov.erase(prov.begin());
81        stable_sort(prov.begin(),prov.end(),comp2);
82        stable_sort(prov.begin(),prov.end(),comp);
83        for(int i=0;i<prov.size();i++)
84        {
85            printf("%s %d\n",prov[i].name.c_str(),prov[i].studentcount);
86        }

87        memset(countarray,0,sizeof(countarray));
88        studentmap.clear();
89        prov.clear();
90        
91    }

92}

93
94


Gohan 2007-07-28 16:37 鍙戣〃璇勮
]]>
pku 3286瑙i鎶ュ憡http://www.shnenglu.com/gohan/archive/2007/07/25/pku3286.htmlGohanGohanWed, 25 Jul 2007 00:20:00 GMThttp://www.shnenglu.com/gohan/archive/2007/07/25/pku3286.htmlhttp://www.shnenglu.com/gohan/comments/28736.htmlhttp://www.shnenglu.com/gohan/archive/2007/07/25/pku3286.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/28736.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/28736.html鎴戠殑鍋氭硶鍙兘寰堝急鏅?br>緇欏畾涓涓暟x>0綆楅氳繃姣忎竴浣嶉浂鍑虹幇嬈℃暟鐨勭粺璁?綆楀嚭鎵鏈夌殑0鐨勬鏁?浠?鍒癤)

涓句竴涓緥瀛?br>2508榪欎釜鏁?br>棣栧厛鑰冭檻涓綅鏁?br>250X  X=0;涓鍏辨湁250-1+1涓?br>25X8  X=0;涓鍏辨湁258-10+1涓?br>2X08 X=0;娉ㄦ剰騫朵笉鍙湁208-100+1涓彲鑳?鎴戜箣鍓嶅氨閿欏湪榪欓噷浜?鍥犱負鏈澶?508,鎵浠?099-2009榪欑櫨浣嶇殑闆舵垜灝辨病鏈夎冭檻鍒?鎵浠ヨ繖閲岀殑0鏈?99-100+1涓?br>
浜庢槸棰樼洰灝卞仛鍑烘潵浜?br>
杈撳叆涓涓猘 b
a<b
a==0鏃?br>b緇熻鍑洪浂鐨勪釜鏁扮劧鍚庡姞1(0)鐨勪釜鏁?br>鍚﹀垯浠巃 鍒?b鐨?鐨勪釜鏁板垯鏄粠1鍒癰鐨?涓暟鍑忓幓浠?鍒癮-1鐨勯浂鐨勪釜鏁?br>a<10鐨勬儏鍐墊垜瀹蟲曞嚭閿欏氨鍒嗗紑鍐欎簡,鎵浠ユ暣涓▼搴忔湁浜涢暱

涓嬮潰灝辨槸鎴戠鎷欑殑浠g爜

 1#include <iostream>
 2#include <string>
 3#include <cstdio>
 4#include <cstdlib>
 5#include <cmath>
 6using namespace std;
 7long long aarray[10]={0};
 8long long barray[10]={0};
 9long long diff[10]={0};
10char tempstr[10= "";
11
12
13int calc(std::string str,int i)
14{
15    //str.erase()
16    if(i==(str.size()-1)) return 0;
17    long long sum=0,len=str.size();
18    int needminus = int(pow(10.0,i));
19    //if(i!=0)str[len-i-2]+=(str[len-i-1]-'0');//new add
20    if(str[len-i-1]=='0')
21    {
22    str.erase(len-i-1,1);
23    }

24    else
25    {
26        str.erase(len-i-1,i+1);
27        str.append(i,'9');
28    }

29    for(int i=0;i<str.size();i++)
30    {
31        sum=sum*10+(str[i]-'0');
32    }

33    sum-=needminus;
34    sum+=1;
35    return sum;
36}

37
38int main()
39{
40    unsigned int a,b;
41    std::string tempstring;
42    int add;
43    while(scanf("%u %u",&a,&b))
44    {
45        add=0;
46
47        if(a==0)
48            add=1;
49        else {
50            add=0;
51            a--;
52        }

53        if(a==-2)
54            break;
55        int alen,blen;
56        if(a<10)
57        {
58            aarray[0]=0;
59        }

60        else
61        {
62            _i64toa(a,tempstr,10);
63            alen = strlen(tempstr);
64            tempstring.assign(tempstr);
65            for(int i=0;i<alen;i++)
66            {
67                aarray[i]=calc(tempstring,i);
68            }

69        }

70        _i64toa(b,tempstr,10);
71        blen = strlen(tempstr);
72        tempstring.assign(tempstr);
73        for(int i=0;i<blen;i++)
74        {
75            barray[i]=calc(tempstring,i);
76        }

77        for(int i=0;i<blen;i++)
78        {
79            diff[i]=barray[i]-aarray[i];
80        }

81        long long sum=0;
82        for(int i=0;i<blen;i++)
83        {
84            sum+=diff[i];
85        }

86        
87        cout<<sum+add<<endl;
88        memset(aarray,0,sizeof(long long)*10);
89        memset(barray,0,sizeof(long long)*10);
90        memset(diff,0,sizeof(long long)*10);
91    }

92}


 



Gohan 2007-07-25 08:20 鍙戣〃璇勮
]]>
涓涓皬緇冧範,甯漢鍋?(a^n)%khttp://www.shnenglu.com/gohan/archive/2007/06/01/25299.htmlGohanGohanFri, 01 Jun 2007 14:49:00 GMThttp://www.shnenglu.com/gohan/archive/2007/06/01/25299.htmlhttp://www.shnenglu.com/gohan/comments/25299.htmlhttp://www.shnenglu.com/gohan/archive/2007/06/01/25299.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/25299.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/25299.html杈撳叆a,n,k錛?<=a,n<=1e9   1<=k<=10000 錛屾敞鎰忥細鏈夊緇勬祴璇曟暟鎹紝璇風敤EOF鏍囧織鍒ゆ柇緇撴潫杈撳叆錛夛細
2 32 5
2 30 5

杈撳嚭(a^n)%k鐨勭粨鏋滐紙a鐨刵嬈℃柟琚玨闄ょ殑浣欐暟錛夛細
杈撳叆a,n,k錛?<=a,n<=1e9   1<=k<=10000 錛屾敞鎰忥細鏈夊緇勬祴璇曟暟鎹紝璇風敤EOF鏍囧織鍒ゆ柇緇撴潫杈撳叆錛夛細
2 32 5
2 30 5

杈撳嚭(a^n)%k鐨勭粨鏋滐紙a鐨刵嬈℃柟琚玨闄ょ殑浣欐暟錛夛細
瑕佹眰澶嶆潅搴︿負O錛坙ogn錛?br>
瑙e喅鎬濊礬,鍚冨睅鍏勭殑鎺ㄥ鐨?br>(a*b)Mod c=((a Mod c)*b)Mod c
a^b Mod c  鎶夿鍐欐垚浜岃繘鍒?At ,At-1,At-2...A1,A0)
a^b Mod c =(a^(At*2^t....A0*2^0)mod c)=

((a^A0*2^0 mod c)*a^A1*2^1mod c).....
t=log2B;

涓嬮潰鏄皬寮熺殑紼嬪簭

#include <iostream>
using namespace std;
int convertToBin(int n,int (&arr)[14])
{
    
int i=0;
    
while(n)
    
{
        arr[i]
=n%2;
        n
=n/2;
        i
++;
    }

    
return i;
}

int findAnswer(int k,int a,int arr[14],int bsize)
{
    
int ret = 1;
    
for(int i=0;i<bsize;i++)
    
{
        
if(arr[i])
            ret
=(ret*a*(1<<i))%k;
        
else
            ret
=(ret*(1<<i))%k;
    }

    
return ret;
}

int main()
{
    
int a,n,k=1;
    
while(!cin.eof())
    
{
        cin
>>a;
            
if(a==-1break;
        cin
>>n>>k;
        
int arr[14]={0};
        
int bsize = convertToBin(n,arr);
        cout
<<findAnswer(k,a,arr,bsize)<<endl;
    }

}


Gohan 2007-06-01 22:49 鍙戣〃璇勮
]]>
瀹炰範蹇?涓ぜ鎷滀簡http://www.shnenglu.com/gohan/archive/2006/08/02/10774.htmlGohanGohanTue, 01 Aug 2006 16:07:00 GMThttp://www.shnenglu.com/gohan/archive/2006/08/02/10774.htmlhttp://www.shnenglu.com/gohan/comments/10774.htmlhttp://www.shnenglu.com/gohan/archive/2006/08/02/10774.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/10774.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/10774.html浠婂ぉ寮濮嬬粰涓夋湡宸ヤ綔鍐欎竴浜涙暟鎹簱PL/SQL鐨勮繃紼嬨?br />鎵撶畻澶т簩瀛︾殑涓滆タ錛?br />(vc#+asp).net聽 php
緇х畫瀛︿範vc++
鍔姏瀛︿範c++ datastruct
瑕佺啛鎮夋暟鎹簱鐩稿叧緙栫▼錛屽ぇ浜屾湡闂翠簤鍙栬兘鎯崇偣涓滆タ緇冩墜銆傘傘傘?br />璺暱闀?..

Gohan 2006-08-02 00:07 鍙戣〃璇勮
]]>
3澶╁疄涔犲皬緇?/title><link>http://www.shnenglu.com/gohan/archive/2006/07/15/10110.html</link><dc:creator>Gohan</dc:creator><author>Gohan</author><pubDate>Sat, 15 Jul 2006 14:38:00 GMT</pubDate><guid>http://www.shnenglu.com/gohan/archive/2006/07/15/10110.html</guid><wfw:comment>http://www.shnenglu.com/gohan/comments/10110.html</wfw:comment><comments>http://www.shnenglu.com/gohan/archive/2006/07/15/10110.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gohan/comments/commentRss/10110.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gohan/services/trackbacks/10110.html</trackback:ping><description><![CDATA[3澶╂椂闂村鐨勪笢瑗夸笉澶氾紝鑼冨洿鍗存瘮杈冨箍銆?br />cb浼氳繘琛屽悇縐嶆暟鎹簱鑱旀帴浜嗭紝浠庢湰鍦癆ccess鏁版嵁搴擄紝鍒版祴璇曠敤鐨凮racle鏈嶅姟鍣ㄣ?br />瀵瑰洟闃熷伐浣滄祦紼嬫湁鎵璁よ瘑銆?br />闃呰浜嗘湰鍏徃鍓嶄笉涔呭畬鎴愮殑浠峰奸楂樼殑婧愮▼搴忕殑鍐板北涓瑙掞紝鍓╀笅鐨勬湁絀烘參鎱㈢湅鍚с?br />瀵逛簬鐗堟湰鎺у埗鎵鐢–VS杞歡鏈夌偣浣撲細銆?br /><br />鐩墠鏈嬈犵己鐨勶紝鍥犱負鎴戜滑涓昏鏄仛瓚呭ぇ鏁版嵁搴撶浉鍏崇紪紼嬶紝鎴戝鏁版嵁搴撶殑鍐呭鎵鐭ュ緢灝戯紝<br />SQL-Command浜熷緟瀛︿範涓涓嬨?br />鍙﹀鑷繁鍦ㄧ湅渚嵎鐨凞issecting MFC錛屽垰寮濮嬬湅銆傘傘備粠娣卞璁よ瘑浣撲細寰蔣榪欎釜搴炲ぇ鐨凢ramework<br />銆傘傘傘傘傘?br /><br />涓嬪懆緇х畫瀹炰範鍚с?img src ="http://www.shnenglu.com/gohan/aggbug/10110.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gohan/" target="_blank">Gohan</a> 2006-07-15 22:38 <a href="http://www.shnenglu.com/gohan/archive/2006/07/15/10110.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏄ㄥぉ錛屼粖澶╋紝鏄庡ぉ銆?/title><link>http://www.shnenglu.com/gohan/archive/2006/07/11/9704.html</link><dc:creator>Gohan</dc:creator><author>Gohan</author><pubDate>Tue, 11 Jul 2006 12:42:00 GMT</pubDate><guid>http://www.shnenglu.com/gohan/archive/2006/07/11/9704.html</guid><wfw:comment>http://www.shnenglu.com/gohan/comments/9704.html</wfw:comment><comments>http://www.shnenglu.com/gohan/archive/2006/07/11/9704.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gohan/comments/commentRss/9704.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gohan/services/trackbacks/9704.html</trackback:ping><description><![CDATA[ <div>鏄ㄥぉ鏃╀笂鍥炴潵鐨勫銆?br />澶у涓騫翠腑瀛﹀埌鐨勪笢瑗挎病鏈夊お澶氥備功...榪樻槸鍙秷鍖栦簡3鏈鐐?..<br />寰堝鏉備貢鏃犵珷鐨勪笢瑗塊渶瑕佸鍚с?br />浠婂ぉ錛屼粛鐒剁湅鐪嬩功錛屼笂涓婃満銆傚噯澶囨槑澶╃殑瀹炰範鐢熸椿銆?br />鎴戞槑澶╀細鍘誨綋鍦板獎鍝嶆渶澶х殑IT鍏徃榪涜涓氫綑瀹炰範錛屽叾瀹炰笉鑳借瀹炰範錛?br />綆楁槸瀛︿範銆傜煡閬撴槑澶╀細鐢ㄥ埌cb,oracle,榪涜COM緇勪歡緙栫▼,鎴戣繕涓鐐歸兘涓嶄細銆?br />鍏跺疄鑷充簬vc鎴戜篃鍙槸console coder...涓嶈繃娌′簨錛屽綋浣滃幓瀛︿範鍚с?br />鏄庡ぉ錛屾湡寰呮槸緹庡ソ鐨勪竴澶╋紝鎴戜細寮ヨˉ澶т竴鐭ヨ瘑鐨勭┖鐧斤紝瀹炶返錛屽疄璺碉紝瀹炶返銆?br />甯屾湜鏃╂棩鍙樺己銆?br /></div> <img src ="http://www.shnenglu.com/gohan/aggbug/9704.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gohan/" target="_blank">Gohan</a> 2006-07-11 20:42 <a href="http://www.shnenglu.com/gohan/archive/2006/07/11/9704.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鈻♀枴鈻♀枴脳鈻?鈻♀枴鈻♀枴http://www.shnenglu.com/gohan/archive/2006/02/19/3336.htmlGohanGohanSun, 19 Feb 2006 12:15:00 GMThttp://www.shnenglu.com/gohan/archive/2006/02/19/3336.htmlhttp://www.shnenglu.com/gohan/comments/3336.htmlhttp://www.shnenglu.com/gohan/archive/2006/02/19/3336.html#Feedback0http://www.shnenglu.com/gohan/comments/commentRss/3336.htmlhttp://www.shnenglu.com/gohan/services/trackbacks/3336.htmlmop涓婃湁浜洪棶榪欎釜濡備綍緙栫▼瀹炵幇
棰樼洰鏄?23456789榪?涓暟瀛楃粍鎴愪竴涓瓑寮?涓嶅彲閲嶅
鈻♀枴鈻♀枴脳鈻?鈻♀枴鈻♀枴
鎴戠殑鎯蟲硶灝辨槸鏋氫婦
浜庢槸錛?BR>
#include <iostream>

using namespace std;

long c[9]={1,1,1,1,1,1,1,1,1};
int check(int);
main()
{
  
for(c[0]=1;c[0]<10;c[0]++)
      
for(c[1]=1;c[1]<10;c[1]++)
          
if (check(1)) ;else
          
for(c[2]=1;c[2]<10;c[2]++)
              
if (check(2)) ; else
              
for(c[3]=1;c[3]<10;c[3]++)
                  
if (check(3)) ;else
                  
for(c[4]=1;c[4]<10;c[4]++)
                      
if (check(4)) ;else
                      
for(c[5]=1;c[5]<10;c[5]++)
                          
if (check(5)) ;else
                          
for(c[6]=1;c[6]<10;c[6]++)
                              
if (check(6)) ;
                              
else for(c[7]=1;c[7]<10;c[7]++)
                                  
if (check(7)) ;
                                  
else for(c[8]=1;c[8]<10;c[8]++){
                                    
if (check(8)) ;
                                    
else if((c[0]*1000+c[1]*100+c[2]*10+c[3])*c[4]==(c[5]*1000+c[6]*100+c[7]*10+c[8])) 
                                        cout
<<c[0]<<c[1]<<c[2]<<c[3]<<"*"<<c[4]<<"="<<c[5]<<c[6]<<c[7]<<c[8]<<endl;
                                  }

                              
                                


                          
}


  
int check(int i){
    
int flag=0;
    
for (int ctr=0;ctr<i;ctr++)
        
if (ctr==i) ctr++;
        
else if(c[ctr]==c[i]) flag++;
    
return flag;

  }


Gohan 2006-02-19 20:15 鍙戣〃璇勮
]]>
久久影视综合亚洲| 国产成人精品三上悠亚久久| 午夜精品久久久久久毛片| 国产三级精品久久| 青青草原综合久久大伊人精品| 中文字幕久久精品无码| 午夜精品久久久久| 四虎久久影院| 久久乐国产综合亚洲精品| 欧美亚洲日本久久精品| 久久久久97国产精华液好用吗| 久久99国产一区二区三区| 国产成人精品久久一区二区三区av | 国产欧美久久一区二区| 久久99精品国产自在现线小黄鸭| 久久综合九色综合网站| 久久精品中文字幕无码绿巨人 | 国产精品久久久久国产A级| 久久精品毛片免费观看| 久久国产精品无码一区二区三区| 精品国产乱码久久久久久1区2区| 国产精品久久久久影院色| 一本大道加勒比久久综合| 精品综合久久久久久88小说| 久久亚洲欧洲国产综合| 一级女性全黄久久生活片免费 | 日本精品久久久久久久久免费| 亚洲欧美精品一区久久中文字幕| 久久亚洲中文字幕精品一区| 日韩精品久久无码人妻中文字幕 | 国产毛片欧美毛片久久久| 国内精品人妻无码久久久影院 | 亚洲欧美成人综合久久久| 97久久精品午夜一区二区| 国产亚洲精久久久久久无码AV| 一本大道久久香蕉成人网| 久久久久亚洲AV无码永不| 久久国产精品无码网站| 伊人久久无码中文字幕| 伊人色综合久久天天| 久久久久se色偷偷亚洲精品av|