标签:amp NPU ase mic 技术 img ima png please
c语言中指针作为参数的函数同时计算两个数的和与差。
1、
#include <stdio.h> void sum_dif(int n1, int n2, int *sum, int *dif) { *sum = n1 + n2; *dif = (n1 > n2) ? (n1 - n2) : (n2 - n1); } int main(void) { int na, nb, wa = 0, sa = 0; puts("please input two integers."); printf("na = "); scanf("%d", &na); printf("nb = "); scanf("%d", &nb); sum_dif(na, nb, &wa, &sa); printf("\nwa: %d\nsa: %d\n", wa, sa); return 0; }
标签:amp NPU ase mic 技术 img ima png please
原文地址:https://www.cnblogs.com/liujiaxin2018/p/14824100.html