2016-06-03 Problem Solving►UVa UVa 11364 - Parking Contents 1. Problem2. Solution3. Code Problem題目網址中文網址 Solution只要停在最左和最右的店家之間,都要來回走一趟回到車子,距離都是 (max - min) * 2 。 CodeUVa 11364UVa 11364 - Parking123456789101112131415161718192021222324#include<cstdio>int main(){ int Case; scanf("%d", &Case); while (Case--) { int n, i, min = 100, max = 0, num; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &num); if (num > max) max = num; if (num < min) min = num; } printf("%d\n", (max - min) * 2); } return 0;} Newer UVa 11743 - Credit Check Older UVa 11795 - Mega Man's Mission