皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
【程序设计】 --------------------------------------------------------- 题目:主函数main()中字符数组s为测试数据,程序将测试数据按 以下规则复制到数组t中,再将数组t中的字符串逆置。规 则如下:已知n为数组元素下标值,对于n为奇数位置的字 符复制n次,对于n为偶数位置的字符只复制一次。 编写程序: 1. 编写函数 void CopyStr(char s[][30],int n, char t[][100]), 将n个字符串s按上述规则进行复制,结果保存在数组t中。 2. 编写void Reserve(char t[][100],int n),将数组t中 n 个字符串逆置。 测试数据:“ABCDEF”,“1234” 运行结果: Stirng ABCDEF is changed as FFFFFEDDDCBA String 1234 is changed as 444321 --------------------------------------------------------- 注意:请勿改动主函数main()中的任何语句。 -------------------------------------------------------*/ #include #include #include #include #include #define N 30 void CopyStr(char s[][30],int n,char t[][100]) { /**********Program**********/ /********** End **********/ } void Reserve(char t[][100],int n) { /**********Program**********/ /********** End **********/ } int main() { char s[N][30]={"ABCDEF","1234"}; char t[N][100]; int i,n=0; FILE *fp; if((fp=fopen("DATA.TXT","w"))==NULL) { printf("File open error\n"); exit(0); } n=2; CopyStr(s,n,t); Reserve(t,n); for(i=0;i
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】听力原文:M: What subjects are you taking this semester? W: I'm taking History, ,Freshman Composition, Western Civilization and Physics. M: That's quite a load. W: Yes. I know it's going to be a lot of wor...
A.
She has earned enough money from the part-time job in summer.
B.
She has got enough money from her parents.
C.
She has saved a lot of money from her winter job.
D.
She has got a grant from her university.
【简答题】根据所给材料,下列说法不正确的是( )。
【单选题】What can be inferred from the first paragraph?
A.
Taking a nap is useless for busy people.
B.
Taking a nap is viewed as something for curing disease.
C.
Taking a nap is regarded as lazy to work.
D.
Taking a nap can promote your work efficiency.
【判断题】近代文学维护知识分子地位的典型代表作是《儒林外史》。()
A.
正确
B.
错误
【单选题】听力原文:M: How is school going, Barbara? Are you taking any new classes? W: I'm taking another really interesting course called Business and the Web. We are learning about e-commerce and how new technolo...
A.
E-commerce.
B.
Wireless communications.
C.
Business and the web.
D.
New technology.
【简答题】What can be inferred from the first paragraph? [A] Taking a nap is useless for busy people. [B] Taking a nap is viewed as something for curing disease. [C] Taking a nap is regarded as lazy to work. [D...
【单选题】I was taking a nap when someone the door.
A.
knocked
B.
knocks
C.
knocking
【单选题】行星齿轮的有一大一小两个圆,两圆同心,在两圆之间的环形部分有另外几个小圆,所有的圆中最大的一个是( )
A.
太阳轮
B.
内齿轮
C.
中心轮
D.
行星轮
【简答题】根据所给的材料,不能得出的结论是( )。
【判断题】近代文学《儒林外史》是维护知识分子地位的典型代表作。()
A.
正确
B.
错误
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题