究竟是用函数好,还是宏定义好?比较两个数或者表达式大小,首先把它写成宏定义:eg:#include<stdio.h>#include<stdlib.h>#define MAX(x,y) ((x) > (y)? (a) : (b))int main(){int a = 2, b = 4;int m = 0;m = MAX(2, 4);printf("%d\n
#include<stdio.h> #include<stdlib.h> //初始化数组 void init(int arr[], int length) { int i = 0; printf("初始化数组->:\n "); for (i&n
#include <stdio.h> #include <stdlib.h> int main() { int i = 0; int sum = 0; int symbol = 1; int n&
#include <stdio.h> #include <stdlib.h> int main() { int sign = 1; double deno = 2.0; double sum = 1.0;
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号