2647 数组中对应元素相减

Time Limit : 2000/1000 MS(Java/Others) | Memory Limit : 65536/32768 KB(Java/Others)

Submits : 104 | Solved : 48

Description

设计函数,实现两个一维数组的对应元素的相减。


Input

在主函数中各输入10个整数到数组a和数组b中


Output

设计函数计算并输出a-b的结果


Sample Input

28 65 78 4 3 2 1 21 -9 -19
3 4 56 -81 8 1 0 10 8 -21

Sample Output

25 61 22 85 -5 1 1 11 -17 2

Template

#include<stdio.h>

@-@  //设计函数
int main()
{
	int a[10],b[10],i;
	for(i=0;i<10;i++)
		scanf("%d",&a[i]);
	for(i=0;i<10;i++)
		scanf("%d",&b[i]);
	sub(a,b,10);  //调用函数
	printf("\n");

return 0;
}

HINT

程序填空题,模板中@-@的位置是需要填空的部分。

Source

NBU OJ

[ Top ] | [ Submit ]