题解 | #公务员面试#

公务员面试

https://www.nowcoder.com/practice/f3a134908d5b41869f14f58307008a97?tpId=290&tqId=309321&ru=%2Fpractice%2Fb8e6a46992fe4e11b2822b20561b6d94&qru=%2Fta%2Fbeginner-programmers%2Fquestion-ranking&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3D%25E8%25AF%25AD%25E6%25B3%2595%25E7%25AF%2587%26topicId%3D290


#include<stdio.h>
int main()
{
	int arr[7] = {0};
	int i = 0, max = 0, min = 100, sum = 0;
	while (scanf("%d", &arr[i]) != EOF)
	{
		if (arr[i] > max)
			max = arr[i];
		if (arr[i] < min)
			min = arr[i];
		sum += arr[i];
		i++;
		if (i == 7)
		{
			printf("%.2f\n", (sum - max - min) / 5.0);
			i = 0, max = 0, min = 100, sum = 0;
		}
	}
	return 0;
}

全部评论

相关推荐

11-15 18:39
已编辑
西安交通大学 Java
全村最靓的仔仔:卧槽,佬啥bg呢,本也是西交么
点赞 评论 收藏
分享
一名愚蠢的人类:多少games小鬼留下了羡慕的泪水
投递荣耀等公司10个岗位
点赞 评论 收藏
分享
评论
1
收藏
分享
牛客网
牛客企业服务