vb中的fun是什么意思

如题所述

fun函数是自定义的C/C++语言函数,函数功能多样。该函数名为“函数”英文function的简写,一般在示例和试题中使用,通常在主函数中被调用。

比如int fun(int x,int y),void fun(char* a,char* b) 等等。有先前的定义,就可以在主函数里调用它,比如ans=fun(3,7);或者fun(p1,p2);。

扩展资料

函数fun的功能是从低位开始依次取出长整型变量s中奇数位上的数,构成一个新数存放在t中。高位仍在高位,低位仍在低位。

例如,当S中的数为7654321时,t中的数为7531

#include <stdio.h>

void fun (long s, long *t)
{ long sl=10;
*t = s % 10;
while ( s > 0)
{ s = s/100;
*t = s%10 * sl + *t;
sl = sl*10;
}
}

main()
{ long s, t;
printf("\nPlease enter s:"); scanf("%ld", &s);
fun(s, &t);
printf("The result is: %ld\n", t);
}

参考资料来源:百度百科-函数fun

温馨提示:答案为网友推荐,仅供参考