24_函数的值调用

来源:互联网 发布:linux 获得变量长度 编辑:程序博客网 时间:2024/05/18 16:14
//_24_函数的值调用//_24_main.cpp//函数的值调用不改变原来的数值#include <stdio.h>#include <stdlib.h>int square(int);//求平方函数int cube(int);//求立方函数int main(){int m = 12;int n = 4;printf("%d %d\n",square(m),m);printf("%d %d\n",cube(n),n);system("pause");return 0;}int square(int x){x = x * x;return x;}int cube(int x){x = x * x * x;return x;}

0 0
原创粉丝点击