[問題] 請問這個程式的結果是怎麼來的呢?
有個問題想請教大家:
C語言 程式碼如下:
#include "stdafx.h"
#include <stdio.h>
#define SQR(r) (r*r)
int main(void)
{
printf( "%d", SQR(3+3+2) );
return 0;
}
這個程式執行後的結果是17,是怎麼求算出來的呢?
不是應該是64嗎?
謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.251.181.55
→
05/18 22:45, , 1F
05/18 22:45, 1F
→
05/18 22:46, , 2F
05/18 22:46, 2F
→
05/18 22:49, , 3F
05/18 22:49, 3F
→
05/18 22:54, , 4F
05/18 22:54, 4F
→
05/18 22:58, , 5F
05/18 22:58, 5F
→
05/18 22:59, , 6F
05/18 22:59, 6F
→
05/18 23:01, , 7F
05/18 23:01, 7F
推
05/19 03:41, , 8F
05/19 03:41, 8F
推
05/19 04:36, , 9F
05/19 04:36, 9F
→
05/19 04:37, , 10F
05/19 04:37, 10F
推
05/19 08:24, , 11F
05/19 08:24, 11F
→
05/19 10:14, , 12F
05/19 10:14, 12F
推
05/19 11:23, , 13F
05/19 11:23, 13F
推
05/19 11:28, , 14F
05/19 11:28, 14F
→
05/19 11:35, , 15F
05/19 11:35, 15F
→
05/19 11:35, , 16F
05/19 11:35, 16F