题解 | #小乐乐找最大数#
小乐乐找最大数
http://www.nowcoder.com/practice/ae6a21920cac4f9184c8ecfcc87f89b9
#include<stdio.h>
int main() {
int a[4], max;
scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]);
max = a[0];
for (int i = 0; i < 4; i++) {
if (max < a[i + 1]) max = a[i + 1];
}
printf("%d", max);
return 0;
}
int main() {
int a[4], max;
scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]);
max = a[0];
for (int i = 0; i < 4; i++) {
if (max < a[i + 1]) max = a[i + 1];
}
printf("%d", max);
return 0;
}