首页 > 试题广场 > #include <iostream.h> vo
[填空题]
#include <iostream.h>
void main( ) {
    int i, u[4], v[4], x, y = 10;
    for (i = 0; i <= 3; i++)
        cin >> u[i];
    v[0] = (u[0] + u[1] + u[2] + u[3]) / 7;
    v[1] = u[0] / ((u[1] - u[2]) / u[3]);
    v[2] = u[0] * u[1] / u[2] * u[3];
    v[3] = v[0] * v[1];
    x = (v[0] + v[1] + 2) - u[(v[3] + 3) % 4];
    if (x > 10) y += (v[2] * 100 - v[3]) / (u[u[0] % 3] * 5);
    else y += 20 + (v[2] * 100 - v[3]) / (u[v[0] % 3] * 5);
    cout << x << "," << y << endl;
} 

输入:9 3 9 4
输出:1
v[0]=3  v[1]=-9  v[2]=12  v[3]=-27
x = (3 + ( - 9) + 2) - u [ ( - 27 + 3 ) % 4] = - 4 - 9 = - 13
y = 10 + 20 + (12 * 100 + 27) / 45=30 + 1227 / 45 = 30 + 27 = 57
输出: - 13 , 57
发表于 2020-10-18 21:15:19 回复(0)