可以直接从输出上进行赋值运算啊?
我之前学C时,都是先进行赋值运算,再进行输出,可是在java上可以直接从输出部分写赋值。
2016-07-17
#include <stdio.h>
int main()
{
int one = 10;
int two = 20;
int three = 0;
printf("three = one + two ==> %d\n", three=one+two);
printf("three += one ==> %d\n", three+=one);
printf("three -= one ==> %d\n", three-=one);
printf("three *= one ==> %d\n", three*=one);
printf("three /= one ==> %d\n", three/=one);
printf("three %= one ==> %d\n", three%=one);
return 0;
}C也可以。
举报