小笨笨的DS學習網誌

★------------- ★------ ★-------------------- ★-------------------- ★--------------------

2010年3月30日 星期二

資料結構作業~~Ch2-3-3e.c

#include <stdio.h>
#include <stdlib.h>
int main() {//主程式
   struct test {               //宣告結構
      int math;
      int english;
      int computer;
      int accounting;   
  };

資料結構作業~~Ch2-3-1e.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct student {       //學生資料
    int id;
    char name[20];
    char Class[10];  
    int math;
    int english;
    int computer;
    int accounting; 
  };
int main() {//主程式

2010年3月21日 星期日

資料結構~第三次作業 修改例題~~

#include
#include
/* 主程式 */
int main() {
/* 學生成績陣列 */
int scores[10] = {76,85,90,67,59,79,82,95,91,65};
int num,num1,num2; /* 學號 */
int grade; /* 成績 */
int i, choice; /* 選項 */
int doit = 1;

2010年3月14日 星期日

資料結構~第二次作業

請說明遞迴是什麼,遞迴擁有哪些特性?遞迴分為哪兩種?
答:◆遞迴:一個問題的內涵是由本身所定義的話,稱之為遞迴。
◆特性:①遞迴函數在每次呼叫時,都可以使問題範圍逐漸縮小。
②函數需要擁有一個終止條件,以便結束遞迴函數的執行,否則遞迴函數並不會
結束,而持續的呼叫自己,類似無窮迴圈。
◆種類:①直接遞迴②間接遞迴