一、运行结果;
二、源代码;
# define _CRT_SECURE_NO_WARNINGS
# include <stdio.h>
int main()
{
//初始化变量值;
int arr[10] = { 0 };
int i = 1;
int n = 1;
int t = 0;
int max = 0;
//提示用户;
printf("请输入10个整数!!!!!\n");
//循环获取十个数据;
while (i <= 10)
{
//提示用户;
printf("请输入第%d个值:", i);
//获取值;
scanf("%d", &arr[i - 1]);
//改变变量;
i++;
}
//赋值;
max = arr[0];
//循环判断最大值;
while (n < 10)
{
//比较;
if (max < arr[n])
{
//改变最大值;
max = arr[n];
}
//改变变量的值;
n++;
}
//循环输出结果;
while (t < 10)
{
//输出用户输入的值;
printf("%d", arr[t]);
//逗号;
printf(",");
//改变变量;
t++;
}
//输出结果;
printf("中最大值为%d", max);
return 0;
}
三、流程图;
四、N-S流程图;