福州广达路168号:求解两道C语言问题(英文)

来源:百度文库 编辑:神马品牌网 时间:2024/05/05 18:48:15
第一道:
Which of the following identifiers are (a)C reserved words,(b)standard identifiers,(c)conventionally used as constant macro names,(d)other valid identifiers ,(e)invalid identifiers?
Void MAX_ENTRIES double time G Sue's return printf xyz123 part#2 "char" #insert this_is_a_long_one

第二道
Write a program that calculates how far a satellite travels in one rotation about the earth, given the satellite’s altitude in kilometers. Use 12.730 Km as the Earth’s diameter.
Use 12,730 Km 只是一个假设值,放多少都没问题,就是要得一个答案出来.辛苦各位了. 我用的是C program Design for Engineers.( Printed in the United States of America. )印刷和排版上肯定不会又任何问题,而且我也检查了好几遍,我在抄录过程中,没有任何错误。

英语不是很好(不敢乱写)~~
第二题:
main()
{float a=12.730,c;
c=2*3.1415*a;
printf("c=%f",c);
}

写错了别砸我啊~~

第二道题是给出地球直径让你求卫星绕地球一周需多长距离~~不过事先告诉你,地球直径不会这么少
公式为L=PI*D其中PI为3.14,D代表直径
#include <stdio.h>
main()
{double L,D,PI;
D=12.73;PI=3.14;
L=D*PI;
printf("the satellite travel the earth :",L);
}

第一题
(a) 关键字:double, return
(b) 标准的标识符:time, G, xyz123, this_is_a_long_one
(c) 通常用于宏名称:MAX_ENTRIES
(d) 其它有效的标识符:Void, MAX_ENTRIES, printf
(e) 无效的标识符:Sue's, part#2, "char", #insert

第二题
这题题目肯定有问题,卫星又不是贴着地面飞的,卫星轨道半径和地球半径是两码事。这道题需要计算地球对卫星的引力,以及卫星绕地球旋转时所产生的离心力,两者相等时可计算出卫星的轨道半径。

卫星是贴着地面飞的(近地卫星),题目里应该是把12\'730 Km写成了12.730 Km。
其实卫星在多高飞都可以,只要有适合的速度就可以了。