#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<windows.h>
int main()
{
int i=0, j=0,max=0;
int arr[10] = {};
for (i = 1; i <= 10; i++)
{
printf("请输入第%d个数\n",i);
scanf("%d", &arr[i]);
}
max = arr[i];
for (j = 2; j <= 10; j++)
{
if (arr[j] >= arr[i])
max = arr[j];
}
printf("最大值为%d\n", max);
system("pause");
return 0;
}
#include<stdio.h>
#include<windows.h>
int main()
{
int i=0, j=0,max=0;
int arr[10] = {};
for (i = 1; i <= 10; i++)
{
printf("请输入第%d个数\n",i);
scanf("%d", &arr[i]);
}
max = arr[i];
for (j = 2; j <= 10; j++)
{
if (arr[j] >= arr[i])
max = arr[j];
}
printf("最大值为%d\n", max);
system("pause");
return 0;
}