#include <stdio.h>
int main(int argc, const char * argv[]) {
int a[10];
for (int i = 0; i < 10; i++) {
printf("请输入定%d个数:\n",i+1);
scanf("%d",&a[i]);
}
for (int i = 0; i < 10; i++) {
printf("%d\t",a[i]);
}
int max = a[0];
for (int i = 1; i < 10; i++) {
if (a[i] > max) {
max = a[i];
}
}
printf("max = %d\n",max);
return 0;
}
|
|