#include <iostream.h> void main(void) { int i, p[5], a, b, c, x, y = 20; for (i = 0; i <= 4; i++) cin >> p[i]; a = (p[0] + p[1]) + (p[2] + p[3] + p[4]) / 7; b = p[0] + p[1] / ((p[2] + p[3]) / p[4]); c = p[0] * p[1] / p[2]; x = a + b - p[(p[3] + 3) % 4]; if (x > 10) y += (b * 100 - a) / (p[p[4] % 3] * 5); else y += 20 + (b * 100 - c) / (p[p[4] % 3] * 5); cout << x << "," << y << endl; }
// 注:本例中,给定的输入数据可以避免分母为0或数组元素下标越界。
输入:6 6 5 5 3
输出:1