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

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


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

正在回答

2 回答

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下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号