#include<stdio.h>
#include<math.h>
Q1:
#if 1
int main() {
float r = 0.07,y = 10,p;
p = pow(1 + r, y);
printf("%f", p);
}
#endif
Q2:
#if 1
int main() {
float r,p;
int n;
p = 1000 * (1 + n * r);//一次五年期
p = 1000 * (1 + 2 * r);
p = p * (1 + 3 * r);//先两年后三年
p = 1000 * pow((1 + r),n);//一年期
p = 1000 * pow((1 + (r / 4)), 4 * n);//活期一季度结算一次
return 0;
}
#endif
Q3:
m = log(p / (p - (d * r))) / log(1 + r);
Q4:
1)a,b 97,98;ascll码
2)一些特殊符号…
3)和1)问是一样的结果
Q5:
a=3b=7
8.5 71.82
65 97
Q6:
#if 1
int main(void)
{
char a, b, c, d, e;
a = 'C';
b = 'h';
c = 'i';
d = 'n';
e = 'a';
//printf("%c%c%c%c%c", a + 4, b + 4, c + 4, d + 4, e + 4);
putchar(a + 4);
putchar(b + 4);
putchar(c + 4);
putchar(d + 4);
putchar(e + 4);
}
#endif
Q7:
#if 1
int main(void)
{
float s,r,h;
s = PI * r * 2;
s = PI * pow(r, 2);
s = 4 * PI * pow(r, 2);
s = 3 / 4 * PI * pow(r, 3);
s = PI * pow(r, 2) * h;
}
#endif
Q8:
#if 1
int main(void)
{
char c1, c2;
c1 = getchar();
c2 = getchar();
putchar(c1);
putchar(c2);
putchar('\n');
printf("%d",c1);
printf("%d",c2);
}
#endif
1)二者皆可;
2)printf函数,以%d格式输出;
3)不可以,位数不一样,存储数据的大小也不一样,很容易导致出错或数据溢出。