[問題] 關於一些算術運算子
(a)What's the output of the following C++ program?
#inclue <iostream>
using namespace std;
int main{}
{
int a=5,b=10,c=15,n,m,p;
c+=5;
n=++a*--b;
m=a+-b*c%b;
p=a++*b+c/b*3;
cout<<"m = "<<m << ", n = " << n << ",p = " << p << end1;
return 0;
}
請問n=++a*--b;
是(++a)*(--b)還是++(a*--b)
還有+-是什麼阿
這些運算子的關係是什麼呢
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.43.205.218
→
03/01 02:03, , 1F
03/01 02:03, 1F
→
03/01 02:04, , 2F
03/01 02:04, 2F
推
03/01 13:20, , 3F
03/01 13:20, 3F
→
03/01 14:10, , 4F
03/01 14:10, 4F
推
03/02 00:03, , 5F
03/02 00:03, 5F
→
03/02 00:54, , 6F
03/02 00:54, 6F