2016-07-10 Problem Solving►UVa UVa 10963 - The Swallowing Ground Contents 1. Problem2. Solution3. Code Problem中文網址 Solution直接看每一行上下相差的是否都一樣。 CodeUVa 1096312345678910111213141516171819202122232425262728#include<cstdio>int main(){ int Case; scanf("%d", &Case); while (Case--) { int n, diff = 0, top, bottom; scanf("%d", &n); while (n--) { scanf("%d%d", &top, &bottom); if (diff != -1) { if (!diff) diff = top - bottom; else if (diff != top - bottom) diff = -1; } } puts(diff == -1 ? "no" : "yes"); if (Case) putchar('\n'); } return 0;} Newer UVa 10054 - The Necklace Older UVa 438 - The Circumference of the Circle