學習自定義函數ide
#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> int MAX(int x, int y) { if (x > y) { return x; } else { return y; } } int main() { int a = 10; int b = 30; int max = MAX(a, b); printf("max=%d\n", max); return 0; } void Swap(int x, int y)//void表示沒有返回值 { int tmp = 0; tmp = x; x = y; y = tmp; } int main() { int a = 10; int b = 20; printf("a=%d b=%d\n", a, b); Swap(a, b); printf("a=%d b=%d\n", a, b); return 0; }//上面所寫程序有bug