ÔÚCÖÐÈçºÎ×öÑÓʱ - C/C++ / CÓïÑÔ
ÎÒ·¢ÏÖÓÿյÄforÓï¾ä×öÑÓʱµÄʱºòÀÏ»úÆ÷»áºÜ³ÔÁ¦¡£C/C++ code:
³¬¹ýÁù°ÙÍò´ÎµÄʱºòCPUÕ¼ÓÃÂÊ´ïµ½100%
ÓÐûÓÐκÍÒ»µãµÄ·½·¨ÄØ£¿
ºÃÁË¡£Ð»Ð»¹þ
²»ÒªÍüÁ˽áÌùÓ´
sleep£¬
Êǵģ¬sleepº¯Êý£¬°üº¬ÔÚ<windows.h>Í·ÎļþÖÐ,×¢ÒâsleepÖÐs´óд
ÎÒÔÚDevÖÐûÓаüº¬windows.hҲûÓÐÓÃSleepµÄ´óд£¬»¹ÊÇ¿ÉÒÔµÄÄØ¡¡
ÿִÐÐÒ»¶¨µÄÑ»·´ÎÊý£¬¿ÉÒÔÐÝÃßÒ»´ÎʹÓã¬sleep»òÕâusleep.
ÀýÈç
sleep(1)Ö¸ÐÝÃß1Ã룬usleep(100)Ö¸ÐÝÃß100΢Ãë¡£
sleepÊÇÒÔºÁÃëΪµ¥Î»µÄ°É¡£usleepÊÇÒÔ΢ÃëΪµ¥Î»µÄ°É¡£
VCÖÐÐèÒªsleep´óдS£¬ÆäËûµÄ±àÒëÆ÷¾Í²»ÓÃÁË°É¡£
ÎҲ鵽µÄ¡£
Ïà¹ØÎÊ´ð£º
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
ËÄÜ°ïÎÒ°ÑÏÂÃæÕâЩ´úÂë¸Ä³ÉVBÐÎʽµÄ£¬¶àлÁË£¬¼±ÓÃ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[],float g ......
visual c++2008Ëٳɰ棬²»ÄܱàÒëC³ÌÐòÂð£¿Èç¹ûÄÜÊÇÔõô¿ªÊ¼µÄ°¡£¿ÓÃËü´øµÄÃüÁîÌáʾµ¥Ôª³ýÍâ ¡£
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£©
¾ø¶Ô¿ÉÒÔ¡£½¨Á¢win32¿ØÖÆ̨³ÌÐò¾Í¿ÉÒÔ
ÒýÓÃ
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£ ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......
[align=center][/align]CÓïÑÔÖÐÈçºÎÅжÏÒ»¸ödoubleÐ͵ÄÊý×飨Èçdouble S[20]£»£©ÊÇÒ»¸ö¿ÕÊý×飬¼´Êý×éÖÐûÓзÅÈκÎÖµ¡£
û°ì·¨¡£
"ÈκÎÖµ" µÄ¶¨Òå?
¾ÍÊÇÊý×éÊǿյģ¬Ã»ÓÐΪËü¸³Öµ
¿ÉÒÔ¿¼Â ......