为了账号安全,请及时绑定邮箱和手机立即绑定

可以直接从输出上进行赋值运算啊?


我之前学C时,都是先进行赋值运算,再进行输出,可是在java上可以直接从输出部分写赋值。

正在回答

3 回答

c也可以的,printf("%d",(a=5));你可以试一下

0 回复 有任何疑惑可以回复我~
#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也可以。

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

可以直接从输出上进行赋值运算啊?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信