C\C++Ïà¹ØÎÊÌâÕûÀí£¨1£©
Ëæ»úÉú³ÉÕûÊý£¬È»ºóËã³öÕý¸ºÁã
void getrand(int *a, int m)
{
int i;
srand(time(NULL));
for (i=0; i<m; i++)
{
a = rand()-rand();
}
}
int main(int argc, char* argv[])
{
int zhengshu=0,fushu=0,zero=0;
int n[MAX];
int i;
for(i=0;i<MAX;i++){
scanf("%d",n+i);
}
//getrand(n,MAX);
//´Ë´¦ÊÇÓÃËæ»úÊý²âÊÔ
for(i=0;i<MAX;i++){
if(n>0)zhengshu++;
else if(n==0)zero++;
else fushu++;
printf("%d ",n);
}
printf("¸ºÊýµÄ¸öÊýÊÇ%d",fushu);
printf("ÕûÊýµÄ¸öÊýÊÇ%d",zhengshu);
printf("ÁãµÄ¸öÊýÊÇ%d",zero);
return 0;
}
1.ʵÏÖÏÂÃæÀàµÄĬÈϹ¹Ô캯ÊýºÍ±ØÒªµÄ¸´ÖÆ¿ØÖƳÉÔ±¡£
class TreeNode{
public:
private:
std::string value;
int count;
TreeNode *left;
TreeNode *right;
};
class TreeNode{
public:
TreeNode():count(0),left(0),right(0){}
TreeNode(const TreeNode &org):value(org.value),count(org.count){
if(org.left)left=new TreeNode(*org.left);
else left=0;
&n
Ïà¹ØÎĵµ£º
C/C++ÖнṹÌå(struct)֪ʶµãÇ¿»¯(ËÄ)
³ö´¦£ºPConline 2005Äê03ÔÂ07ÈÕ ×÷Õߣº¹ÜÄþ ÔðÈα༣ºxietaoming
http://pcedu.pconline.com.cn/empolder/gj/c/0503/567942_5.html
¡¡¡¡×îºóѧϰһÏÂÈçºÎÔÚÒÑÓеÄÁ´±íÉϲåÈë½Úµã
¡¡¡¡ÎÒÃÇÒª¿¼ÂÇËÄÖÐÇé¿ö,
¡¡¡¡1.Á´±íΪ¿Õ!
¡¡¡¡2.²åÈëµãÔÚÊ×½Úµãǰ
¡¡¡¡3.²åÈëµãÕÒ² ......
Ç°ÃæÒ»ÆªÎÒÃǽéÉÜÁ˽ṹÌ壬ÕâÆªÖÕÓÚÄܹ»½éÉܺ¯ÊýÁË¡£ÎªÊ²Ã´ÕâÃ´ËµÄØ£¿ÒòΪº¯Êý·Ç³£ÖØÒª¡£¾ÍÕâô¼òµ¥¡£ºÙºÙ£¡Ö®ËùÒÔÔÚÕâʱ²Å½²º¯Êý£¬ÊÇÒòΪ±¾Æª½«ÁªÏµµ½Ç°ÃæµÄÿһƪ£¬ÕâÑùº¯Êý²ÅÄÜÌåÏÖµÄ͸³¹¡£ÄÇÎÒÃÇ¾ÍÆÈ²»¼°´ýµÄÇÐÈëÕýÌâ¡£
´ÓµÚһƪHelloworld¿ªÊ¼µ½ÏÖÔÚ£¬¾ÍûÓÐÍÑÀ뺯Êý¡£ÄǾÍÊÇÎÒÃǵÄmainº¯Êý¡£mainº¯ÊýÒ²ÊÇÒ»¸öÆÕͨµÄ ......
l Ò»Ö±¶ÔÕâ¿éÄÚÈݶ¼ºÜâðÍ·£¬ÒòΪËü¿´²»µ½Ãþ²»×Å£¬ÎÒÃÇÖ»Äܶ¢×Å×îºó±àÒëÁ´½ÓÖ®ºóµÄ½á¹ûÊdzɹ¦»òÊÇʧ°Ü£¬µ«ÊÇÈ´²»ÖªµÀ±àÒëÆ÷ÄÚ²¿ÊÇÈçºÎ²Ù×÷µÄ£»
l ÿµ±±àÒëÆ÷¸ø³ö´íÎóʱÎÒÃǶ¼Ö»Êǵ¥´¿µÄÈ¥´¦Àí´íÎó£¬È´²»ÖªµÀ±àÒëÆ÷ÊÇÈçºÎÕÒ³öÀ´µÄ£»
......
×÷ÕߣºÍõæ©æ©,»ªÇåÔ¶¼ûǶÈëʽѧԺ½²Ê¦¡£
ÔÚǶÈëʽ¿ª·¢ÖУ¬×÷Ϊµ×²ã¿ª·¢Õߣ¬¸ü¿´ÖصÄÊÇCÓïÑԵıà³ÌÄÜÁ¦£¬µ«×÷ΪӦÓóÌÐòµÄ¿ª·¢Õߣ¬ÎÒÏëѧϰC++»¹ÊÇÓбØÒªµÄ¡£ÄãÖ»ÓÐÔÚÁ˽âÁË£Ã++µÄÌØÐÔ£¬´Ó±¾ÖÊÉÏ¿´µ½ËüÓëCµÄÇø±ð²ÅÄܼᶨÄãÈÏʶѧϰËüµÄ¾öÐÄ¡£ÎÒ²»ÊÇר¼Ò£¬µ«ÊÇ´ÓÎÒѧϰµÄÀú³ÌÉÏÀ´¿´£¬Ñ§Ï°£Ã£«£«»¹ÊÇÓÐÐèÒªµÄ£¬²»ÂÛÄã×ö£Ñ£Ô ......