肥宅乐
2016-07-17 11:21
我之前学C时,都是先进行赋值运算,再进行输出,可是在java上可以直接从输出部分写赋值。
c也可以的,printf("%d",(a=5));你可以试一下
#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也可以。
Java入门第一季(IDEA工具)升级版
1165550 学习 · 17586 问题
相似问题