Posted on:
Last modified:
int max(int n, ...) {
va_list arg_pointer;
int result = INT_MIN;
va_start(arg_pointer, n);
for (int i = 0; i < n; i++) {
int arg = va_arg(arg_pointer, int);
if (arg > result)
result = arg;
}
va_end(arg_pointer);
return result;
}
© 2016-2022 Yifei Kong. Powered by ynotes
All contents are under the CC-BY-NC-SA license, if not otherwise specified.
Opinions expressed here are solely my own and do not express the views or opinions of my employer.
友情链接: MySQL 教程站