顯示文章

這裡允許您檢視這個會員的所有文章。請注意, 您只能看見您有權限閱讀的文章。


主題 - gcobt44292

頁: [1]
1
 是什麼意思

2
int t(int h[][4]);
int main(void)
{
   int a[6][4],g=0;


   while(g!=5){
      system("cls");

      printf("歡迎來到!樂透世界~~~\n");


      printf("請輸入5組號碼,1組4個數字,介於0到9之間,請勿重複,多出一個數字出現錯誤請自行負責,別怪我!!\n");

      write(a);
      write(a);
      write(a);
      write(a);
      write(a);
      good(a);
      good(a);
      good(a);
      good(a);
      good(a);
      e(a);
      t(a);
      t(a);
      t(a);
      t(a);
      t(a);
      printf("還想繼續試試手氣嗎?\n");
      printf("繼續試手氣請按1\n");
      printf("不想試了請按5\n");
      scanf("%d",&g);


   }
   printf("~~~~~~~~~~~~~\n|歡迎下次蒞臨|\n~~~~~~~~~~~~~");

   system("pause");
   return 0;
}
int t(int h[][4])
{
   int i,j,counter;
   static int v=0;
   v++;
   if(v==1){
      for(i=0;i<4;i++){
         for(j=0;j<4;j++){
            if(h[0]==h[5][j]){
               counter++;
            }
         }
      }
      if(counter==4){
         printf("恭喜你中了4個數字拿到了10000元\n");
      }
      if(counter==3){
         printf("恭喜你中了3個數字拿到了1000元\n");
      }
      if(counter<3){
         printf("真可惜!你沒中,請再接再厲!\n");
      }

      return 0;
   }
   if(v==2){
      for(i=0;i<4;i++){
         for(j=0;j<4;j++){
            if(h[1]==h[5][j]){
               counter++;
            }
         }
      }
      if(counter==4){
         printf("恭喜你中了4個數字拿到了10000元\n");
      }
      if(counter==3){
         printf("恭喜你中了3個數字拿到了1000元\n");
      }
      if(counter<3){
         printf("真可惜!你沒中,請再接再厲!\n");
      }

      return 0;
   }
   if(v==3){
      for(i=0;i<4;i++){
         for(j=0;j<4;j++){
            if(h[2]==h[5][j]){
               counter++;
            }
         }
      }
      if(counter==4){
         printf("恭喜你中了4個數字拿到了10000元\n");
      }
      if(counter==3){
         printf("恭喜你中了3個數字拿到了1000元\n");
      }
      if(counter<3){
         printf("真可惜!你沒中,請再接再厲!\n");
      }

      return 0;
   }
   if(v==4){
      for(i=0;i<4;i++){
         for(j=0;j<4;j++){
            if(h[3]==h[5][j]){
               counter++;
            }
         }
      }
      if(counter==4){
         printf("恭喜你中了4個數字拿到了10000元\n");
      }
      if(counter==3){
         printf("恭喜你中了3個數字拿到了1000元\n");
      }
      if(counter<3){
         printf("真可惜!你沒中,請再接再厲!\n");
      }

      return 0;
   }
   if(v==5){
      for(i=0;i<4;i++){
         for(j=0;j<4;j++){
            if(h[4]==h[5][j]){
               counter++;
            }
         }
      }
      if(counter==4){
         printf("恭喜你中了4個數字拿到了10000元\n");
      }
      if(counter==3){
         printf("恭喜你中了3個數字拿到了1000元\n");
      }
      if(counter<3){
         printf("真可惜!你沒中,請再接再厲!\n");
      }
      v=0;
      return 0;
   }
}

3
我要問計算機概論的2元收尋樹的 前序 中序 後序 的排法

4
C/C++程式設計討論區 / 2元收尋
« 於: 2013-12-18 22:54 »
能幫我寫個最基本的2元收尋嗎

5
 cubebyreference是傳回值所以必須要用void
cubebyvalue是傳值所以不一定要用void嗎?
cubebyvalue為啥需要return回main?而cubebyreference不需要?

6
C/C++程式設計討論區 / 問題
« 於: 2013-12-17 21:07 »
#include<stdio.h>
#include<stdlib.h>
#define size 20
size_t getsize(float *ptr);
int main(void)
{
float array[size];
printf("the number of bytes in the array is %u""\nthe number of bytes returned bt getsize is %u\n",sizeof(array),getsize(array));
}//end main
size_t getsize(float *ptr)
{
return sizeof(ptr);
}
運算出來the number of bytes in the array is 80為什麼, float為啥是4  float array[size]--4*20

另外%p是將16禁制列印出來?

7
C/C++程式設計討論區 / 有人會C++嗎
« 於: 2013-12-17 17:26 »
 :'(

頁: [1]