#include<stdio.h>
#include<math.h>
int main()
{
float a,b,c,s,area;
scanf_s("%f,%f,%f",&a,&b,&c);
s = 1.0/2*(a + b +c) ;
area = sqrt(s * (s - a) * (s - b) * (s - c));
printf("a=%7.2f, b=%7.2f, c=%7.2f, s=%7.2f\n",a,b,c,s);
printf("area=%7.2f\n", area);
}
题目什麽要求啊?
你输入的数据界面截图看一下,输入的数值之间加逗号了吗?
int local_num = 1;
int fun_2(int num)
{
return num+local_num;
}
-----------------
<fun_2>:
push {fp} ; (str fp, [sp, #-4]!)
add fp, sp, #0
sub sp, sp, #12
str r0, [fp, #-8]
ldr r3, [pc, #24] ; 30 <fun_2+0x30>
ldr r2, [r3]
ldr r3, [fp, #-8]
add r3, r2, r3
mov r0, r3
add sp, fp, #0
pop {fp}
bx lr
这部分的功能示意图如上
这段代码访问了调用者的局部数据和被调用者的局部数据,从这段代码可以看出,被调用者的局部数据在 fp 的负偏移的地址,调用者的局部数据在 fp 的正偏移地址