133. 四整數相乘

 avatar
user_6817964
c_cpp
2 years ago
395 B
0
Indexable
Never
int mymul(int* a, int size);
int mymul(int* a, int size) {
    int mul = 1;
    for (int i = 0; i < size; i++) {
        mul *= *a;
        a++;
    }
    return mul;
}

int main() {
    int data[4] = {};
    for (int i = 0; i < 4; i++) {
        scanf("%d", &data[i]);
    }
    int size = sizeof(data) / sizeof(data[0]);
    printf("%d\n", mymul(data, size));
    return 0;
}