佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

楼主: Wongkokchoy

Asignment新的小问题。。。

[复制链接]
 楼主| 发表于 9-10-2008 08:34 PM | 显示全部楼层
请问大大有谁会用goto loop 吗?

我朋友的code需要用到。(虽然很冒险)

他的code:
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 9-10-2008 08:38 PM | 显示全部楼层
  1. start:                 <----------------------------------------------------------------
  2. displayLine2();
  3. cout<<" 1 - Recommanded";
  4. cout<<"\n 2 - Self-customize\n";
  5. displayLine2();
  6. do
  7. {
  8. cout<<"\nOption:";
  9. cin>>option1;
  10. }
  11. while ( (option1 != 1)&&(option1 !=2)  );


  12.     switch (option1)
  13.     {
  14.         case 1 :
  15.        {cout<<"lease enter the budget you want.\n\n";
  16.        displayLine2();
  17.        cout<<"a - <RM15400\n";
  18.        cout<<"b - RM1500-RM2000\n";
  19.        cout<<"c - >RM2000\n";
  20.        displayLine2();
  21.       cout<<"\n";
  22.       cout<<"Option:";
  23.        cin>>option2;
  24.            if ( toupper(option2) == 'A')
  25.           {
  26.           cout<<"This is the specs we recommand for the required budget.\n";
  27.          displayLine2();
  28.          cout<<"HARDWARE\t\t\t\t\tPRICE\n";
  29.          displayLine2();
  30.          cout<<"Motherboard\n";
  31.          cout<<"ASUS P5N-MX-GF 610i Chipset\t\t\tRM 185.00\n\n";

  32.          cout<<"rocessor\n";
  33.          cout<<"AMD Athlon LE 1640\t\t\t\tRM 136.00\n\n";

  34.          cout<<"Hard Drive\n";
  35.          cout<<"Samsung 160GB\t\t\t\t\tRM 135.00\n\n";

  36.          cout<<"Display Card\n";
  37.          cout<<"owerColor ATI Radeon HD2400PRO 256MB DDR2\tRM 150.00\n\n";

  38.          cout<<"RAM\n";
  39.          cout<<"C5300 DDR2-667 1GB\t\t\t\tRM 69.00\n\n";

  40.          cout<<"DVD-ROM\n";
  41.          cout<<"Samsung 20X SATA Dual Layer DVD Writer\t\tRM 99.00\n\n";

  42.          cout<<"Chassis\n";
  43.          cout<<"owerLogic Futura F220 Casing 220W\t\tRM 89.00\n\n";

  44.          cout<<"Cooling\n";
  45.          cout<<"Cooler Master Hyper TX2 CPU Cooler\t\tRM 85.00\n\n";

  46.          cout<<"Operating System\n";
  47.          cout<<"Microsoft Windows Vista Home Basic\t\tRM 255.00\n\n";
  48.          displayLine2();
  49.          cout<<"Total\t\t\t\t\t\tRM 1184.00\n";
  50.          displayLine2();

  51.          }

  52.          else if ( toupper(option2) == 'B')
  53.           {
  54.          cout<<"Motherboard\n\n";
  55.          cout<<"MSI MS7501-AMD 780G Chipset\t\t\t\tRM267.00\n\n";

  56.          cout<<"rocessors\n\n";
  57.          cout<<"Intel Pentium D 2.0 G\t\t\t\t\tRM223.00\n\n";

  58.          cout<<"Hard Drives\n";
  59.          cout<<"Seagate 250GB\t\t\t\t\t\tRM167.00\n\n";

  60.          cout<<"Display Card\n";
  61.          cout<<"owerColor ATI Radeon HD3650 512MB DDR2\t\t\tRM245.00\n\n";

  62.          cout<<"RAM\n";
  63.          cout<<"C5300 DDR2-667 1GB\t\t\t\t\tRM 69.00\n\n";

  64.          cout<<"DVD-ROM\n";
  65.          cout<<"Samsung 20X SATA Dual Layer DVD Writer\t\t\tRM 99.00\n\n";

  66.          cout<<"Chassis\n";
  67.          cout<<"Cooler Master Elite 330 CAsing\t\t\t\tRM135.00\n\n";

  68.          cout<<"Cooling\n";
  69.          cout<<"Cooler Master Hyper TX2 CPU Cooler\t\t\tRM 85.00\n\n";

  70.          cout<<"Operating System\n";
  71.          cout<<"Microsoft Windows Vista Home Premium\t\t\tRM 295.00\n\n";
  72.          displayLine2();
  73.          cout<<"Total\t\t\t\t\t\t\tRM 1585.00\n";
  74.          displayLine2();

  75.           }

  76.          else if ( toupper(option2) == 'C')
  77.          {
  78.          cout<<"Motherboard\n";
  79.          cout<<"MSI MS7512 Platinum (CF)- P45 chipset\t\t\tRM412.00\n\n";

  80.          cout<<"rocessors\n";
  81.          cout<<"Intel Core2 Duo 2.53 G\t\t\t\t\tRM386.00\n\n";

  82.          cout<<"Hard Drives\n";
  83.          cout<<"Seagate 320GB\t\t\t\t\t\tRM182.00\n\n";

  84.          cout<<"Display Card\n";
  85.          cout<<"owerColor ATI Radeon HD3850 512MB DDR3\t\t\tRM470.00\n\n";

  86.          cout<<"RAM\n";
  87.          cout<<"C5300 DDR2-667 2GB\t\t\t\t\tRM 145.00\n\n";

  88.          cout<<"DVD-ROM\n";
  89.          cout<<"ioneer 20X SATA Dual Layer DVDRW\t\t\tRM125.00\n\n";

  90.          cout<<"Chassis\n";
  91.          cout<<"Cooler MAster Centurion 590 (ST) Casing\t\t\tRM239.00\n\n";

  92.          cout<<"Cooling\n";
  93.          cout<<"Cooler Master Hyper 212 CPU Cooler\t\t\tRM 148.00\n\n";

  94.          cout<<"Operating System\n";
  95.          cout<<"Microsoft Windows Vista Home Ultimate\t\t\tRM 650.00\n\n";
  96.          displayLine2();
  97.          cout<<"Total\t\t\t\t\t\t\tRM 2757.00\n";
  98.          displayLine2();

  99.          }
  100.          cout<<"Do you wish to continue?(y/n):";
  101.          cin>>cont;
  102.          if (cont == 'y')
  103.          goto start;      <--------------------------------------------------

  104.       }
  105.         case 2:
  106.       {
  107.        cout<<"Below are the prices list of all specs which we offer,\n";
  108.       cout<<"You can choose the specs you want by insert the number stated\n\n";


  109.        for (int x=0 ; x<=8 ;x++ )
  110.        {
  111.       price[x]=0;
  112.      .............
  113. ....................
  114.       price_total+=price[x];
  115.       }
  116.     }
  117.       cout<<"\nnnnnnnnnnnnnnnnnnnnn\n";
  118.       cout<<"<< Total = RM"<<price_total<<" >>\n";
  119.       cout<<"vvvvvvvvvvvvvvvvvvvv\n";

  120.    }
  121. }
复制代码

[ 本帖最后由 Wongkokchoy 于 9-10-2008 08:45 PM 编辑 ]
回复

使用道具 举报

发表于 9-10-2008 09:22 PM | 显示全部楼层

回复 121# Wongkokchoy 的帖子

不明白为什么要用到goto, 无论如何, syntax 如下
  1. #include <iostream>

  2. using namespace std;

  3. int main()
  4. {
  5.     int input;

  6.     cout << "goto : ";
  7.     cin >> input;

  8.     switch(input)
  9.     {
  10.         case 1:
  11.             goto ab;

  12.         case 2:
  13.             goto ac;

  14.         case 3:
  15.             goto ad;

  16.         case 4:
  17.             goto af;
  18.     }

  19. ab:

  20.             cout << "ab" << endl;
  21. ac:

  22.             cout << "ac" << endl;
  23. ad:

  24.             cout << "ad" << endl;
  25. af:
  26.             cout << "af" << endl;

  27.             return 0;
  28. }
复制代码
回复

使用道具 举报

 楼主| 发表于 10-10-2008 12:13 AM | 显示全部楼层
我的朋友想让user key-in 'y' 之后,回去前面再run过,有想过要用do-while loop, 可是因为前面已经用了do-while loop, 两个do-while loop 混淆了

我的问题:

我现在的program是当其中一个player打'Q'的时候, 整个program就停了,所以我想改成就算某某player quit 了,其他的player还是可以continue玩下去。

想过放do-while, 可是因为之前已经有一个do-while了, 所以行不通。。。
有什么建议吗?
回复

使用道具 举报

 楼主| 发表于 10-10-2008 12:18 AM | 显示全部楼层
  1. #include <iostream.h>             // header file
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <time.h>
  5. #include <ctype.h>

  6. void Line();                     // function phototypes
  7. void Ladder(char[]);
  8. void Snake(char[]);
  9. void wall();
  10. void winner(int, char[]);

  11. void main()
  12. {
  13.     char dice, **name;                                      // declaration of variable
  14.     int A, n, number, next, x, reverse, *player;
  15.     Line();                                         // function call
  16.    <<endl;
  17.     cout<<"*******************************************************************************"<<endl<<endl;
  18.     cout<<"\t\tWelcome to Snake and Ladder Game!!\n\n";            // instuction
  19.     cout<<"Introduction: if a player reach a point where there is a ladder, he/she will \nraise to a higher location.\n";
  20.     cout<<"\nOn the other hand, if the player reach a spot where there is a snake over there,the player will drop to a lower location.\n\n";
  21.     cout<<"The 1st player who reach 100 first will be the WINNER!!!!!!\n";
  22.     Line();                                        // function call

  23.     do                                                // do-while loop to avoid user to key in negative value or zero
  24.     {
  25.     cout<<"\nPlease enter the numbers of players:\n";
  26.     cin>>n;
  27.     cin.get();
  28.     if (n<=0)
  29.     cout<<"INVALID number of player!\n";
  30.     }
  31.     while (n<=0);
  32.     player=new int [n];             // declare array "player" and "name"
  33.     name=new char* [n];
  34.     for(int i = 0; i < n ;i++)
  35.     name[i] = new char[100];
  36.     for (int x=0; x<n; x++)
  37.     {
  38.     cout<<"Please enter player "<<(x+1)<<"'s name.\n";     //records players' name

  39.     cin.getline (name[x], 100);
  40.     }
  41.     for (int x=0; x<n; x++)
  42.     {
  43.     cout<<"Player "<<(x+1)<<"'s name is "<<name[x]<<".\n";
  44.     }
  45.     cout<<"\nSo there will be "<<n<<" player(s) in the game.\n";
  46.     cout<<"There are ladders at 4, 9, 19, 21, 28, 51, 71. 80 \n(80 will directly send you to the vitory!!)\n";
  47.     cout<<"Snakes located at 17, 54, 62, 64, 87, 93, 96, 98.\n\n";
  48.     cout<<"(All players start at 0)\n\n\n";
  49.     cout<<"Good Luck and Have Fun!!!\n\n";
  50.     Line();                      // funciton call
  51.     for (x = 0; x < n; x++)    // sets all cell values in the array player to 0
  52.     player[x] = 0;
  53.     do
  54.     {
  55.         for (x=0; x<n; x++)    // save players' position into array "player"
  56.         {
  57.             number=x+1;
  58.             cout<<"\n\n\n\n\n\n"<<name[x]<<" is now at position "<<player[x]<<".\n";    // tell players their position and snake and ladders' location
  59.             cout<<"Ladders (4, 9, 19, 21, 28, 51, 71. 80)\n";
  60.             cout<<"Snakes  (17, 54, 62, 64, 87, 93, 96, 98)\n\n";
  61.             srand(time(0));            // seeds the random sequence generated by rand() later

  62.             do                         // a do-while loop to ensure that the choice entered by users is either t or q
  63.             {
  64.             cout<<"Press 'T' to throw a dice!\nPress 'Q' to quit game.\n";
  65.             cin>>dice;
  66.             if (toupper(dice) !='Q' && toupper(dice) !='T')     // toupper is used so that it is exercuate without
  67.                                                                // considering the upper and lower case of the choice
  68.             {
  69.             Line();                   // funciton call
  70.             cout<<"\nINVALID CHOICE.\n\n";
  71.             Line();                   // funciton call
  72.             }
  73.             }
  74.             while (toupper(dice)!='Q'&& toupper(dice)!='T');
  75.             if (toupper(dice)=='Q')
  76.             {
  77.             cout<<"\n\n\nUser had quit the game.";           // exits from the loop when user key in 'q' or 'Q'
  78.             cin.get();
  79.             cin.get();
  80.             break;
  81.             }
  82.             else if (toupper(dice)=='T')
  83.             {
  84.                 A=(rand()%6)+1;     // randomly generate a number from 1 to 6
  85.                  if (A==1)
  86.                 cout<<"\n   \n . \n   \n\n\n"<<name[x]<<" gets 1!!\n";   // displays to tell users the number on the 'dice'
  87.                 else if (A==2)
  88.                  cout<<"\n . \n   \n . \n\n\n"<<name[x]<<" gets 2!!\n";
  89.                 else if (A==3)
  90.                 cout<<"\n.  \n . \n  .\n\n\n"<<name[x]<<" gets 3!!\n";
  91.                 else if (A==4)
  92.                 cout<<"\n. .\n   \n. .\n\n\n"<<name[x]<<" gets 4!!\n";
  93.                 else if (A==5)
  94.                 cout<<"\n. .\n . \n. .\n\n\n"<<name[x]<<" gets 5!!\n";
  95.                 else if (A==6)
  96.                 cout<<"\n. .\n. .\n. .\n\n\n"<<name[x]<<" gets 6!!\n";
  97.                 player[x]+=A;

  98.                 if( player[x] > 100 )     // when users' position is over 100, user will reverse to their respective position
  99.                 {
  100.                 reverse = player[x]-100;
  101.                 wall();           // funciton call
  102.                 cin.get();
  103.                 cout<<""<<name[x]<<" had reached "<<player[x]<<"!\n\n";
  104.                 cin.get();
  105.                 player[x] = 100 - ( player[x] - 100 );
  106.                 cout<<" Ops!! "<<name[x]<<" knocks the wall!\n"<<name<<" will reverse "<<reverse<<" steps......\n\n";
  107.                 wall();           // funciton call
  108.                 cout<<""<<name[x]<<" is now at position "<<player[x]<<"!\n\n";
  109.                 cin.get();

  110.                 }

  111.                 switch (player[x])   // place the location of snakes and ladders
  112.                 {
  113.                 case 4:
  114.                 Ladder(name[x]);     // funciton call
  115.                 player[x]=14;
  116.                   break;
  117.                      case 9:
  118.                       Ladder(name[x]);     // funciton call
  119.                 player[x]=31;
  120.                 break;
  121.                   case 19:
  122.                   Ladder(name[x]);    // funciton call
  123.                   player[x]=38;
  124.                 break;
  125.                    case 21:
  126.                     Ladder(name[x]);    // funciton call
  127.                 player[x]=42;
  128.                  break;
  129.                     case 28:
  130.                  Ladder(name[x]);    // funciton call
  131.                  player[x]=84;
  132.                 break;
  133.                     case 51:
  134.                     Ladder(name[x]);    // funciton call
  135.                    player[x]=67;
  136.                 break;
  137.                     case 71:
  138.                  Ladder(name[x]);    // funciton call
  139.                   player[x]=91;
  140.                 break;
  141.                   case 80:
  142.                   Ladder(name[x]);   // funciton call
  143.                   player[x]=100;
  144.                 break;
  145.                   case 17:
  146.                   Snake(name[x]);    // funciton call
  147.                   player[x]=7;
  148.                 break;
  149.                   case 62:
  150.                   Snake(name[x]);     // funciton call
  151.                   player[x]=19;
  152.                 break;
  153.                   case 54:
  154.                   Snake(name[x]);     // funciton call
  155.                   player[x]=34;
  156.                 break;
  157.                   case 64:
  158.                   Snake(name[x]);     // funciton call
  159.                   player[x]=60;
  160.                 break;
  161.                   case 87:
  162.                   Snake(name[x]);     // funciton call
  163.                    player[x]=24;
  164.                 break;
  165.                  case 93:
  166.                  Snake(name[x]);      // funciton call
  167.                    player[x]=73;
  168.                 break;
  169.                   case 95:
  170.                   Snake(name[x]);      // funciton call
  171.                   player[x]=75;
  172.                 break;
  173.                  case 98:
  174.                   Snake(name[x]);     // funciton call
  175.                   player[x]=79;
  176.                 break;
  177.                   }
  178.                 cin.get();
  179.                 cout<<""<<name[x]<<" had reached "<<player[x]<<"!\n\n";    // displays usres' position
  180.                 cin.get();
  181.                 next = x+2;
  182.                }
  183.             if (player[x]==100)                      // exits loops when one of the players reach 100
  184.             {
  185.             winner (number, name[x]);
  186.             break;
  187.             }
  188.         if (next==n+1)
  189.                next=1;
  190.                cout<<"\n\n\n\n"<<name[next]<<"'s turn!!!\n\n\n\n\n\n";
  191.         }
  192.     if (toupper(dice)=='Q')
  193.     break;
  194.   }
  195. while(player[x]!=100);                 // keep the looping untill a player reach 100
  196. }                                  // end of main funciton


  197. // functions definition


  198. void Line()
  199. {
  200. cout<<"-------------------------------------------------------------------------------\n";
  201. }

  202. void Ladder(char name[])
  203. {
  204. cin.get();
  205. cout<<"\n\nHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH_LADDER_HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH\n\n";
  206. cout<<"\nLook!! There is a ladder over there!\n";
  207. cin.get();
  208. cout<<""<<name<<" climb up the ladder.\n";
  209. }

  210. void Snake(char name[])
  211. {
  212. cin.get();
  213. cout<<"\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SNAKE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n";
  214. cout<<"\nWoot!! "<<name<<" meets an anaconda!!!!\n";
  215. cin.get();
  216. cout<<"In order to escape from the snake, "<<name<<" had run away.\n";
  217. }

  218. void wall()
  219. {
  220. cout<<"\n\n`````````````````````````````````WALL``````````````````````````````````````````\n\n";
  221. }

  222. void winner(int number,char name[] )
  223. {
  224. cin.get();
  225. cout<<"\n\n----------------------------------WINNER---------------------------------------\n";
  226. cout << "\nPlayer  [" <<number<< "] - "<<name<<" win!!!!\n\nCongratulation!!!\n\n"<<endl;
  227. cout<<"----------------------------------WINNER---------------------------------------\n";
  228. }

  229. //end of functions definition
复制代码
回复

使用道具 举报

 楼主| 发表于 10-10-2008 03:21 PM | 显示全部楼层
另一个无礼取闹的error:

  1. for (int x=0; x<n; x++)
  2.     {
  3.     cout<<"Please enter player "<<(x+1)<<"'s name.\n";     //records players' name

  4.     cin.getline (name[x], 100);
  5.     }
  6.     for (int x=0; x<n; x++)
  7.     {
  8.     cout<<"Player "<<(x+1)<<"'s name is "<<name[x]<<".\n";
  9.     }
  10.     for (x=0; x<n; x++)    // save players' position into array "player"next = number;
  11.         {
  12.         next=x+1;
  13.               if (next==n+1)
  14.                next=0;
  15.                cout<<"\n\n\n\n"<<name[next]<<"'s turn!!!\n\n\n\n\n\n";
  16.         }
复制代码


括弧那些应该没问题,第一次looping的时候没问题,可是要loop第二次的时候,就会出现
Thread stopped.
Fault: access violation at 0x407c01:write of address 0X18
之前的是
next = x+2;
        if (next==n+1)
               next=1;
               cout<<"\n\n\n\nPlayer "<<next<<"'s turn!!!\n\n\n\n\n\n";

本来没有问题的,value一改问题就来了

谁能帮我看看?
file:///C:/Users/User/AppData/Local/Temp/moz-screenshot.jpgfile:///C:/Users/User/AppData/Local/Temp/moz-screenshot-1.jpg
回复

使用道具 举报

Follow Us
发表于 10-10-2008 04:13 PM | 显示全部楼层
可以给我整个code吗?
我每onlyonly酱强看半个就可以理解
回复

使用道具 举报

发表于 10-10-2008 04:33 PM | 显示全部楼层

回复 126# Wongkokchoy 的帖子

阿chai。。
你的PROGRAM还没做好“妹”?
对了。。
我队友说过后DR会要我们加她刚教的FILE HANDLING 和FUNCTION。。
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 10-10-2008 04:49 PM | 显示全部楼层
[code]
// functions definition


void Line()
{
cout<<"-------------------------------------------------------------------------------\n";
}

void Ladder(char name[])
{
cin.get();
cout<<"\n\nHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH_LADDER_HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH\n\n";
cout<<"\nLook!! There is a ladder over there!\n";
cin.get();
cout<<""<<name<<" climb up the ladder.\n";
}

void Snake(char name[])
{
cin.get();
cout<<"\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SNAKE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n";
cout<<"\nWoot!! "<<name<<" meets an anaconda!!!!\n";
cin.get();
cout<<"In order to escape from the snake, "<<name<<" had run away.\n";
}

void wall()
{
cout<<"\n\n`````````````````````````````````WALL``````````````````````````````````````````\n\n";
}

void winner(int number,char name[] )
{
cin.get();
cout<<"\n\n----------------------------------WINNER---------------------------------------\n";
cout << "\nPlayer  [" <<number<< "] - "<<name<<" win!!!!\n\nCongratulation!!!\n\n"<<endl;
cout<<"----------------------------------WINNER---------------------------------------\n";
}

//end of functions definition
{/code]
回复

使用道具 举报

 楼主| 发表于 10-10-2008 05:02 PM | 显示全部楼层
[code]
// functions definition


void Line()
{
cout<<"-------------------------------------------------------------------------------\n";
}

void Ladder(char name[])
{
cin.get();
cout<<"\n\nHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH_LADDER_HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH\n\n";
cout<<"\nLook!! There is a ladder over there!\n";
cin.get();
cout<<""<<name<<" climb up the ladder.\n";
}

void Snake(char name[])
{
cin.get();
cout<<"\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SNAKE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n";
cout<<"\nWoot!! "<<name<<" meets an anaconda!!!!\n";
cin.get();
cout<<"In order to escape from the snake, "<<name<<" had run away.\n";
}

void wall()
{
cout<<"\n\n`````````````````````````````````WALL``````````````````````````````````````````\n\n";
}

void winner(int number,char name[] )
{
cin.get();
cout<<"\n\n----------------------------------WINNER---------------------------------------\n";
cout << "\nPlayer  [" <<number<< "] - "<<name<<" win!!!!\n\nCongratulation!!!\n\n"<<endl;
cout<<"----------------------------------WINNER---------------------------------------\n";
}

//end of functions definition
{/code]
回复

使用道具 举报

发表于 10-10-2008 05:20 PM | 显示全部楼层
WONG的LINE有点问题...

#include              // header file
#include
#include
#include
#include

void Line();                     // function phototypes
void Ladder(char[]);
void Snake(char[]);
void wall();
void winner(int, char[]);

void main()
{
    char dice, **name;                                      // declaration of variable
    int A, n, number, next, x, reverse, *player;
    Line();                                         // function call
    cout<<"*******************************************************************************"<<
    cout<<"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"<<
    cout<<" WW     WW     WW  EEEEEE  LL       CCCCCC   OOOOO   M       M  EEEEEE "<
    cout<<"  WW   WWWW   WW   EE      LL      CC       OO   OO  M M   M M  EE     "<
    cout<<"   WW WW  WW WW    EEEEEE  LL     CC       OO     OO M  M M  M  EEEEEE "<
    cout<<"    WWW    WWW     EE      LL      CC       OO   OO  M       M  EE     "<
    cout<<"     W      W      EEEEEE  LLLLLL   CCCCCC   OOOO    M       M  EEEEEE "<<<
    cout<<"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"<
    cout<<"*******************************************************************************"<<
    cout<<"\t\tWelcome to Snake and Ladder Game!!\n\n";            // instuction
    cout<<"Introduction: if a player reach a point where there is a ladder, he/she will \nraise to a higher location.\n";
    cout<<"\nOn the other hand, if the player reach a spot where there is a snake over there,the player will drop to a lower location.\n\n";
    cout<<"The 1st player who reach 100 first will be the WINNER!!!!!!\n";
    Line();                                        // function call

    do                                                // do-while loop to avoid user to key in negative value or zero
    {
    cout<<"\nPlease enter the numbers of players:\n";
    cin>>n;
    cin.get();
    if (n<=0)
    cout<<"INVALID number of player!\n";
    }
    while (n<=0);
    player=new int [n];             // declare array "player" and "name"
    name=new char* [n];
    for(int i = 0; i < n ;i++)
    name = new char[100];
    for (int x=0; x
    {
    cout<<"Please enter player "<<(x+1)<<"'s name.\n";     //records players' name

    cin.getline (name[x], 100);
    }
    for (int x=0; x
    {
    cout<<"Player "<<(x+1)<<"'s name is "<<<".\n";
    }
    cout<<"\nSo there will be "<<<" player(s) in the game.\n";
    cout<<"There are ladders at 4, 9, 19, 21, 28, 51, 71. 80 \n(80 will directly send you to the vitory!!)\n";
    cout<<"Snakes located at 17, 54, 62, 64, 87, 93, 96, 98.\n\n";
    cout<<"(All players start at 0)\n\n\n";
    cout<<"Good Luck and Have Fun!!!\n\n";
    Line();                      // funciton call
    for (x = 0; x < n; x++)    // sets all cell values in the array player to 0
    player[x] = 0;
    do
    {
        for (x=0; x
        {
            number=x+1;
            cout<<"\n\n\n\n\n\n"<<<" is now at position "<<<".\n";    // tell players their position and snake and ladders' location
            cout<<"Ladders (4, 9, 19, 21, 28, 51, 71. 80)\n";
            cout<<"Snakes  (17, 54, 62, 64, 87, 93, 96, 98)\n\n";
            srand(time(0));            // seeds the random sequence generated by rand() later

            do                         // a do-while loop to ensure that the choice entered by users is either t or q
            {
            cout<<"Press 'T' to throw a dice!\nPress 'Q' to quit game.\n";
            cin>>dice;
            if (toupper(dice) !='Q' && toupper(dice) !='T')     // toupper is used so that it is exercuate without
                                                               // considering the upper and lower case of the choice
            {
            Line();                   // funciton call
            cout<<"\nINVALID CHOICE.\n\n";
            Line();                   // funciton call
            }
            }
            while (toupper(dice)!='Q'&& toupper(dice)!='T');
            if (toupper(dice)=='Q')
            {
            cout<<"\n\n\nUser had quit the game.";           // exits from the loop when user key in 'q' or 'Q'
            cin.get();
            cin.get();
            break;
            }
            else if (toupper(dice)=='T')
            {
                A=(rand()%6)+1;     // randomly generate a number from 1 to 6
                     if (A==1)
                cout<<"\n   \n . \n   \n\n\n"<<<" gets 1!!\n";   // displays to tell users the number on the 'dice'
                else if (A==2)
                     cout<<"\n . \n   \n . \n\n\n"<<<" gets 2!!\n";
                else if (A==3)
                cout<<"\n.  \n . \n  .\n\n\n"<<<" gets 3!!\n";
                else if (A==4)
                cout<<"\n. .\n   \n. .\n\n\n"<<<" gets 4!!\n";
                else if (A==5)
                cout<<"\n. .\n . \n. .\n\n\n"<<<" gets 5!!\n";
                else if (A==6)
                cout<<"\n. .\n. .\n. .\n\n\n"<<<" gets 6!!\n";
                player[x]+=A;

                if( player[x] > 100 )     // when users' position is over 100, user will reverse to their respective position
                {
                reverse = player[x]-100;
                wall();           // funciton call
                cin.get();
                cout<<""<<<" had reached "<<<"!\n\n";
                cin.get();
                player[x] = 100 - ( player[x] - 100 );
                cout<<" Ops!! "<<<" knocks the wall!\n"<<<" will reverse "<<<" steps......\n\n";
                wall();           // funciton call
                cout<<""<<<" is now at position "<<<"!\n\n";
                cin.get();

                }

                switch (player[x])   // place the location of snakes and ladders
                {
                case 4:
                Ladder(name[x]);     // funciton call
                player[x]=14;
                          break;
                                         case 9:
                                          Ladder(name[x]);     // funciton call
                player[x]=31;
                break;
                          case 19:
                          Ladder(name[x]);    // funciton call
                          player[x]=38;
                break;
                           case 21:
                            Ladder(name[x]);    // funciton call
                player[x]=42;
                     break;
                            case 28:
                     Ladder(name[x]);    // funciton call
                     player[x]=84;
                break;
                            case 51:
                            Ladder(name[x]);    // funciton call
                           player[x]=67;
                break;
                            case 71:
                     Ladder(name[x]);    // funciton call
                          player[x]=91;
                break;
                          case 80:
                          Ladder(name[x]);   // funciton call
                          player[x]=100;
                break;
                          case 17:
                          Snake(name[x]);    // funciton call
                          player[x]=7;
                break;
                          case 62:
                          Snake(name[x]);     // funciton call
                          player[x]=19;
                break;
                          case 54:
                          Snake(name[x]);     // funciton call
                          player[x]=34;
                break;
                          case 64:
                          Snake(name[x]);     // funciton call
                          player[x]=60;
                break;
                          case 87:
                          Snake(name[x]);     // funciton call
                           player[x]=24;
                break;
                     case 93:
                     Snake(name[x]);      // funciton call
                           player[x]=73;
                break;
                          case 95:
                          Snake(name[x]);      // funciton call
                          player[x]=75;
                break;
                     case 98:
                          Snake(name[x]);     // funciton call
                          player[x]=79;
                break;
                          }
                cin.get();
                cout<<""<<<" had reached "<<<"!\n\n";    // displays usres' position
                cin.get();
                next = x+1;
               cout<<"\n\n\n\n"<<<"'s turn!!!\n\n\n\n\n\n";
               }
            if (player[x]==100)                      // exits loops when one of the players reach 100
            {
            winner (number, name[x]);
            break;
            }
        if (next==n+1)
        cout<<"\n\n\n\n"<<<"'s turn!!!\n\n\n\n\n\n";
        }
    if (toupper(dice)=='Q')
    break;
  }
while(player[x]!=100);                 // keep the looping untill a player reach 100
}                                  // end of main funciton


// functions definition
回复

使用道具 举报

发表于 10-10-2008 06:45 PM | 显示全部楼层
你是不是要说

before
  1. next = x+2;
  2.         if (next==n+1)
  3.                next=1;

复制代码


after

  1. next = x+1;
  2.         if (next==n+1)
  3.                next=0;
复制代码


而新的code run不到???
回复

使用道具 举报

 楼主| 发表于 10-10-2008 07:18 PM | 显示全部楼层
差不多是酱啰, 之前可以的,换一换value就不行
了。。。。
回复

使用道具 举报

发表于 10-10-2008 08:13 PM | 显示全部楼层

回复 126# Wongkokchoy 的帖子

logic error

n 是多少个玩家, 比如两个
n = 2,

慢慢来分析

    for (x=0; x<n; x++)    // save players' position into array "player"next = number;
        {
        next=x+1;
              if (next==n+1)
               next=0;
               cout<<"\n\n\n\n"<<name[next]<<"'s turn!!!\n\n\n\n\n\n";
        }
----------------------
n = 2,

x = 0 的时候,
x<n // true 0 < 2

next =  0 + 1 // next == 1

              if (next==n+1) // 1 !=  2 + 1

cout<<"\n\n\n\n"<<name[next]<<"'s turn!!!\n\n\n\n\n\n"; // cout << name[1] ?? 应该是 cout << name[0] 吧

x = 1 的时候
x < n // true 1 < 2

next = 1 + 1 // next

              if (next==n+1) // 2 !=  2 + 1

cout<<"\n\n\n\n"<<name[next]<<"'s turn!!!\n\n\n\n\n\n"; // cout << name[2] ??????? 你只有 name[0] 与 name[1] ,
name[2] 的话当然是memory violation 啊。。。

继续

x = 2,
x < n // false 2 < 2

quit loop,

所以你看, 你的
              if (next==n+1)
               next=0;

毫无用处, 因为 next 永远不可能 == n + 1 的。

[ 本帖最后由 onlylonly 于 10-10-2008 08:22 PM 编辑 ]
回复

使用道具 举报

发表于 10-10-2008 08:16 PM | 显示全部楼层

回复 133# Wongkokchoy 的帖子

你要的应该是这个.

  1.     for (x=0; x<n; x++)    // save players' position into array "player"next = number;
  2.         {
  3.         next=x+1;
  4.               if (next==n+1)
  5.                next=0;
  6.                cout<<"\n\n\n\n"<<name[next]<<"'s turn!!!\n\n\n\n\n\n";
  7.         }
复制代码
换成
  1.                 next = x+1;       
  2.         if (next>=n)
  3.                next=0;

  4.         cout << "\n\n\n\n" << name[next] << "'s turn!!!\n\n\n\n\n\n\n";
  5.         }
复制代码
回复

使用道具 举报

发表于 10-10-2008 08:17 PM | 显示全部楼层

回复 135# onlylonly 的帖子

完整的 code
  1. #include <iostream.h>             // header file
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <time.h>
  5. #include <ctype.h>

  6. void Line();                     // function phototypes
  7. void Ladder(char[]);
  8. void Snake(char[]);
  9. void wall();
  10. void winner(int, char[]);

  11. void main()
  12. {
  13.     char dice, **name;                                      // declaration of variable
  14.     int A, n, number, next, x, reverse, *player;
  15.     Line();                                         // function call
  16.     cout<<"*******************************************************************************"<<endl<<endl;
  17.     cout<<"\t\tWelcome to Snake and Ladder Game!!\n\n";            // instuction
  18.     cout<<"Introduction: if a player reach a point where there is a ladder, he/she will \nraise to a higher location.\n";
  19.     cout<<"\nOn the other hand, if the player reach a spot where there is a snake over there,the player will drop to a lower location.\n\n";
  20.     cout<<"The 1st player who reach 100 first will be the WINNER!!!!!!\n";
  21.     Line();                                        // function call

  22.     do                                                // do-while loop to avoid user to key in negative value or zero
  23.     {
  24.     cout<<"\nPlease enter the numbers of players:\n";
  25.     cin>>n;
  26.     cin.get();
  27.     if (n<=0)
  28.     cout<<"INVALID number of player!\n";
  29.     }
  30.     while (n<=0);
  31.     player=new int [n];             // declare array "player" and "name"
  32.     name=new char* [n];
  33.     for(int i = 0; i < n ;i++)
  34.     name[i] = new char[100];
  35.     for (int x=0; x<n; x++)
  36.     {
  37.     cout<<"Please enter player "<<(x+1)<<"'s name.\n";     //records players' name

  38.     cin.getline (name[x], 100);
  39.     }
  40.     for (int x=0; x<n; x++)
  41.     {
  42.     cout<<"Player "<<(x+1)<<"'s name is "<<name[x]<<".\n";
  43.     }
  44.     cout<<"\nSo there will be "<<n<<" player(s) in the game.\n";
  45.     cout<<"There are ladders at 4, 9, 19, 21, 28, 51, 71. 80 \n(80 will directly send you to the vitory!!)\n";
  46.     cout<<"Snakes located at 17, 54, 62, 64, 87, 93, 96, 98.\n\n";
  47.     cout<<"(All players start at 0)\n\n\n";
  48.     cout<<"Good Luck and Have Fun!!!\n\n";
  49.     Line();                      // funciton call
  50.     for (x = 0; x < n; x++)    // sets all cell values in the array player to 0
  51.     player[x] = 0;
  52.     do
  53.     {
  54.         for (x=0; x<n; x++)    // save players' position into array "player"
  55.         {
  56.             number=x+1;
  57.             cout<<"\n\n\n\n\n\n"<<name[x]<<" is now at position "<<player[x]<<".\n";    // tell players their position and snake and ladders' location
  58.             cout<<"Ladders (4, 9, 19, 21, 28, 51, 71. 80)\n";
  59.             cout<<"Snakes  (17, 54, 62, 64, 87, 93, 96, 98)\n\n";
  60.             srand(time(0));            // seeds the random sequence generated by rand() later

  61.             do                         // a do-while loop to ensure that the choice entered by users is either t or q
  62.             {
  63.             cout<<"Press 'T' to throw a dice!\nPress 'Q' to quit game.\n";
  64.             cin>>dice;
  65.             if (toupper(dice) !='Q' && toupper(dice) !='T')     // toupper is used so that it is exercuate without
  66.                                                                // considering the upper and lower case of the choice
  67.             {
  68.             Line();                   // funciton call
  69.             cout<<"\nINVALID CHOICE.\n\n";
  70.             Line();                   // funciton call
  71.             }
  72.             }
  73.             while (toupper(dice)!='Q'&& toupper(dice)!='T');
  74.             if (toupper(dice)=='Q')
  75.             {
  76.             cout<<"\n\n\nUser had quit the game.";           // exits from the loop when user key in 'q' or 'Q'
  77.             cin.get();
  78.             cin.get();
  79.             break;
  80.             }
  81.             else if (toupper(dice)=='T')
  82.             {
  83.                 A=(rand()%6)+1;     // randomly generate a number from 1 to 6
  84.                  if (A==1)
  85.                 cout<<"\n   \n . \n   \n\n\n"<<name[x]<<" gets 1!!\n";   // displays to tell users the number on the 'dice'
  86.                 else if (A==2)
  87.                  cout<<"\n . \n   \n . \n\n\n"<<name[x]<<" gets 2!!\n";
  88.                 else if (A==3)
  89.                 cout<<"\n.  \n . \n  .\n\n\n"<<name[x]<<" gets 3!!\n";
  90.                 else if (A==4)
  91.                 cout<<"\n. .\n   \n. .\n\n\n"<<name[x]<<" gets 4!!\n";
  92.                 else if (A==5)
  93.                 cout<<"\n. .\n . \n. .\n\n\n"<<name[x]<<" gets 5!!\n";
  94.                 else if (A==6)
  95.                 cout<<"\n. .\n. .\n. .\n\n\n"<<name[x]<<" gets 6!!\n";
  96.                 player[x]+=A;

  97.                 if( player[x] > 100 )     // when users' position is over 100, user will reverse to their respective position
  98.                 {
  99.                 reverse = player[x]-100;
  100.                 wall();           // funciton call
  101.                 cin.get();
  102.                 cout<<""<<name[x]<<" had reached "<<player[x]<<"!\n\n";
  103.                 cin.get();
  104.                 player[x] = 100 - ( player[x] - 100 );
  105.                 cout<<" Ops!! "<<name[x]<<" knocks the wall!\n"<<name<<" will reverse "<<reverse<<" steps......\n\n";
  106.                 wall();           // funciton call
  107.                 cout<<""<<name[x]<<" is now at position "<<player[x]<<"!\n\n";
  108.                 cin.get();

  109.                 }

  110.                 switch (player[x])   // place the location of snakes and ladders
  111.                 {
  112.                 case 4:
  113.                 Ladder(name[x]);     // funciton call
  114.                 player[x]=14;
  115.                   break;
  116.                      case 9:
  117.                       Ladder(name[x]);     // funciton call
  118.                 player[x]=31;
  119.                 break;
  120.                   case 19:
  121.                   Ladder(name[x]);    // funciton call
  122.                   player[x]=38;
  123.                 break;
  124.                    case 21:
  125.                     Ladder(name[x]);    // funciton call
  126.                 player[x]=42;
  127.                  break;
  128.                     case 28:
  129.                  Ladder(name[x]);    // funciton call
  130.                  player[x]=84;
  131.                 break;
  132.                     case 51:
  133.                     Ladder(name[x]);    // funciton call
  134.                    player[x]=67;
  135.                 break;
  136.                     case 71:
  137.                  Ladder(name[x]);    // funciton call
  138.                   player[x]=91;
  139.                 break;
  140.                   case 80:
  141.                   Ladder(name[x]);   // funciton call
  142.                   player[x]=100;
  143.                 break;
  144.                   case 17:
  145.                   Snake(name[x]);    // funciton call
  146.                   player[x]=7;
  147.                 break;
  148.                   case 62:
  149.                   Snake(name[x]);     // funciton call
  150.                   player[x]=19;
  151.                 break;
  152.                   case 54:
  153.                   Snake(name[x]);     // funciton call
  154.                   player[x]=34;
  155.                 break;
  156.                   case 64:
  157.                   Snake(name[x]);     // funciton call
  158.                   player[x]=60;
  159.                 break;
  160.                   case 87:
  161.                   Snake(name[x]);     // funciton call
  162.                    player[x]=24;
  163.                 break;
  164.                  case 93:
  165.                  Snake(name[x]);      // funciton call
  166.                    player[x]=73;
  167.                 break;
  168.                   case 95:
  169.                   Snake(name[x]);      // funciton call
  170.                   player[x]=75;
  171.                 break;
  172.                  case 98:
  173.                   Snake(name[x]);     // funciton call
  174.                   player[x]=79;
  175.                 break;
  176.                   }
  177.                 cin.get();
  178.                 cout<<""<<name[x]<<" had reached "<<player[x]<<"!\n\n";    // displays usres' position
  179.                 cin.get();
  180.                 next = x+2;
  181.                }
  182.             if (player[x]==100)                      // exits loops when one of the players reach 100
  183.             {
  184.             winner (number, name[x]);
  185.             break;
  186.             }

  187.                 next = x+1;       
  188.         if (next>=n)
  189.                next=0;

  190.         cout << "\n\n\n\n" << name[next] << "'s turn!!!\n\n\n\n\n\n\n";
  191.         }
  192.     if (toupper(dice)=='Q')
  193.     break;
  194.   }
  195. while(player[x]!=100);                 // keep the looping untill a player reach 100
  196. }                                  // end of main funciton


  197. // functions definition


  198. void Line()
  199. {
  200. cout<<"-------------------------------------------------------------------------------\n";
  201. }

  202. void Ladder(char name[])
  203. {
  204. cin.get();
  205. cout<<"\n\nHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH_LADDER_HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH\n\n";
  206. cout<<"\nLook!! There is a ladder over there!\n";
  207. cin.get();
  208. cout<<""<<name<<" climb up the ladder.\n";
  209. }

  210. void Snake(char name[])
  211. {
  212. cin.get();
  213. cout<<"\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SNAKE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n";
  214. cout<<"\nWoot!! "<<name<<" meets an anaconda!!!!\n";
  215. cin.get();
  216. cout<<"In order to escape from the snake, "<<name<<" had run away.\n";
  217. }

  218. void wall()
  219. {
  220. cout<<"\n\n`````````````````````````````````WALL``````````````````````````````````````````\n\n";
  221. }

  222. void winner(int number,char name[] )
  223. {
  224. cin.get();
  225. cout<<"\n\n----------------------------------WINNER---------------------------------------\n";
  226. cout << "\nPlayer  [" <<number<< "] - "<<name<<" win!!!!\n\nCongratulation!!!\n\n"<<endl;
  227. cout<<"----------------------------------WINNER---------------------------------------\n";
  228. }

  229. //end of functions definition
复制代码
回复

使用道具 举报


ADVERTISEMENT

发表于 10-10-2008 08:26 PM | 显示全部楼层
这几天都应该不会常上来了, 连环考试 。。。 没有间隔。。 显了。。 天天都要背书。。
回复

使用道具 举报

发表于 10-10-2008 10:30 PM | 显示全部楼层
小弟新来, 请大家多多指教
看了第一页,觉得这个ASSIGNMENT很有趣,自己试一试。
花了差不多整天
暂时做到n player可以轮流玩,到了5就宣布那一个player win the game.
接下来的迟些再试试。

#include  <iostream.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define m 50
void Line()
{
cout<<"-------------------------------------------------------------------------------\n";
}
int main()
{
char dice;
int A, n;
int answer[m] = {0};
int player[m];
Line();
cout<<"\t\tWelcome to Snake and Ladder Game!!\n\n";
cout<<"Introduction: if a player reach a point where there is a ladder, he/she will \nraise to a higher location.\n";
cout<<"\nOn the other hand, if the player reach a spot where there is a snake over there,the player will drop to a lower location.\n";
Line();
cout<<"\n Now please enter the numbers of players:\n";
cin>>n;
cout<<"\nSo there will be "<<<" player(s) in the game.\n";
cout<<"Good Luck and Have Fun!!!\n\n";
cout<<"(All players start at 0)\n\n\n";

//while ((answer1 )<10 && (answer2 <10)&&(answer3 <10))
//{
for (int x=1; x<=n; x++)
{
        cout<<"Now is player "<<<"'s turn!"<<"\n";
        player[x]=0;
        cout<<" Press 't' to throw a dice!\n";
        cin>>dice;
        if (dice=='t')
               
                srand(time(NULL));
                A=rand()%6+1;                //Generate dice number

                if (A==1)
                        {
                        cout<<"\n   \n";
                        cout<<" . \n";
                        cout<<"   \n";
                        cout<<"\n\nYou get 1!!\n";
                        }
                else if (A==2)
                        {
                        cout<<"\n . \n";
                        cout<<"   \n";
                        cout<<" . \n";
                        cout<<"\n\nYou get 2!!\n";
                        }
                else if (A==3)
                        {
                        cout<<"\n.  \n";
                        cout<<" . \n";
                        cout<<"  .\n";
                        cout<<"\n\nYou get 3!!\n";
                        }
                else if (A==4)
                        {
                        cout<<"\n. .\n";
                        cout<<"   \n";
                        cout<<". .\n";
                        cout<<"\n\nYou get 4!!\n";
                        }
                else if (A==5)
                        {
                        cout<<"\n. .\n";
                        cout<<" . \n";
                        cout<<". .\n";
                        cout<<"\n\nYou get 5!!\n";
                        }
                else if (A==6)
                        {
                        cout<<"\n. .\n";
                        cout<<". .\n";
                        cout<<". .\n";
                        cout<<"\n\nYou get 6!!\n";
                        }

        answer[x]+=A;
        cout<<" Player "<<<" had reached "<<<"\n";
        if (answer[x]==5)
        {
                cout<<" Player "<<< " win the game"<
                x=n+3 ; //terminate game
        }
        else if (answer[x]>5)
        {
                cout<<"more than 5. Freezee one time"<
                answer[x]=answer[x]-A;
                cout<<" Player "<<<" now at previous location, which is step "<<
                        if (x==n)   // to prevent program terminated unexpecetedly.
                        x=0;
               
        }
        else if (answer[x]<=4)
        {
                                        //        cout<<"Haven't reach 5. Next player"<
                if (x==n)   // player 1 take turn again
                        x=0;
        }

}
return 0;
}

[ 本帖最后由 lliioonn 于 10-10-2008 10:35 PM 编辑 ]
回复

使用道具 举报

发表于 10-10-2008 10:43 PM | 显示全部楼层

回复 138# lliioonn 的帖子

很少看到有人会自动尝试学习的了。 加油。

之前小弟不才写了一个, 或许你可以参考

http://cforum2.cari.com.my/viewt ... ;page=2#pid48851033
回复

使用道具 举报

发表于 11-10-2008 02:00 AM | 显示全部楼层
原帖由 onlylonly 于 10-10-2008 10:43 PM 发表
很少看到有人会自动尝试学习的了。 加油。


我有时候很牛皮下的 我不懂这样对不对
要死心了,才看答案
不懂这样对不对,因为有时候一题会想很久

之前小弟不才写了一个, 或许你可以参考
http://cforum2.cari.com.my/viewthread.php?tid=1357625&page=2#pid48851033


刚学POINTER,看到*这个符号脑袋就有点转不过来
迟些比较有空才看。
请问你用了多少时间呢

[ 本帖最后由 lliioonn 于 11-10-2008 02:04 AM 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 24-12-2025 02:58 AM , Processed in 0.131514 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表