原创 C primer plus(編程練習)file-2.12-7

#include <stdio.h> //微笑函數 void smile() { printf("Smile!"); } void main() { int i; for(i=0; i<3; i++)

原创 C primer plus(編程練習)file-2.12-8

#include <stdio.h> void one_three() { printf("one\n"); } void two() { printf("two\n"); printf("three\

原创 C primer plus(編程練習)file-2.12-4

#include <stdio.h> void jolly() { printf("For he's a jolly good fellow!\n"); } void deny() { printf("Whic

原创 C primer plus(編程練習)file-3.11-2

#include <stdio.h> void main() { int ascii; printf("please enter ASCII :"); scanf("%d", &ascii);

原创 實驗報告->數組的定義和使用->兩路合併法合併兩個升序數組

/* 用“兩路合併法”把兩個已按升序排列的數組合併成一個升序數組。例如:a數組內容爲1、3、4、7、9、11、15,b數組爲2、5、6、8、12、13、19,合併後的結果爲1、2、3、4、5、6、7、8、9、11、12、13、1

原创 C primer plus(編程練習)file-2.12-1

#include <stdio.h> void main() { printf("Zhang zai\n"); printf("Zhang\nZai\n"); printf("Zhang ");

原创 C primer plus(編程練習)file-2.12-6

#include <stdio.h> void main() { int toes=10; printf("toes = %d\n", toes); printf("toes*2 = %d\n", to

原创 C primer plus(編程練習)file-2.12-2

#include <stdio.h> void main() { printf("Zhang Zai\n"); printf("上海市虹口區\n"); }

原创 C primer plus(編程練習)file-2.12-3

#include <stdio.h> void main() { int old=21, days=365; printf("old = %d\n", old); printf("days = %d\n

原创 實驗報告->數組的定義和使用->字符串逆置

/* 把s字符串中的內容逆置。 例如,s原有的字符串爲:abcdefg, 逆置後,串中的內容爲:gfedcba。 */ #include <stdio.h> #define N 100 void fun(char *s,

原创 實驗報告->數組的定義和使用->連接兩個字符串

/* 程序填空,將兩個字符串連接起來,不要使用strcat函數。 */ #define N 40 #include <stdio.h> void main() { int i=0, j=0; char s[N]

原创 《C語言及程序設計》教學視頻 示例代碼

2017-05-01 //創建一個鏈表 #include <stdio.h> #include <malloc.h> typedef struct Link{ int data; struct Link *ne

原创 實驗報告->數組的定義和使用->冒泡排序和選擇排序

/對序列6, 5, 9, 4, 13, 1, 8按從大到小的順序排列輸出,要求每個數佔6列,並且左對齊輸出。/ #include <stdio.h> //數組打印函數 void Print(int *x, int N) {

原创 《C語言及程序設計》教學視頻 示例代碼

2017-05-02 //創建一個有序鏈表,並且在鏈表中刪除節點 #include <stdio.h> #include <malloc.h> typedef struct Link{ int data; st

原创 【項目1 - C/C++語言中函數參數傳遞的三種方式】

#include<stdio.h> //(1)傳值 void myswap_1(int x, int y) { int t; t=x; x=y; y=t; } int main() {