#include<stdio.h>//在C++中的结果
int Change(int i);
main(){
int i=7;
int j=Change(i);
printf("%d , %d",i,j);
}
int Change(int i){
return i+=i-=i*=i;
}
/*
, 0
-----------------------------------------------
Process returned: 0 (0x0)
Execution time: 14 ms
Maximum memory use: 407 KB
-----------------------------------------------
Press any key to continue . . .
*/
//在 Java中的运行结果
/**
* Created by Xi Yin on 2016/9/8.
*/
public class TestPlusPlus {
public static void main(String[] args){
int i=6;
System.out.println(i);
int j=Change(i);
System.out.println("Value1: "+i+" Value2: "+j);
}
public static int Change(int k){
return k+=k-=k*=k;
}
}
/*
*
Value1: 6 Value2: -24
Process finished with exit code 0
* */
onemoo
函数式编程
郎朗坤
相关分类