题目内容
完善以下程序达到要求的功能,填写括号内的内容先从键盘上输入一个3行3列整型数组的各个元素的值,然后输出主对角线和次对角线元素之和。#includeint main(){int a[3][3], sum = 0, sum1 = 0;int i, j;printf("Enter data:\n");for (i = 0; i<3; i++)for (j = 0; j<3; j++)scanf("%d", &a[i][j]);for (i = 0; i<3; i++){sum = sum + a[i][i];sum1 = sum1 + a[i][()];}printf("\nsum=%5d,sum1=%5d\n", sum, sum1);return 0;}括号内的内容是____?
查看答案
搜索结果不匹配?点我反馈