摘要: 1输入一个字符串和一个正整数x,将该字符串中的后x个字符复制到另一个字符串y中,输出字符串y;再对y串的内容前后倒置后存入数组z中并输出。 要求:用指针访问数组元素、用函数getx(char *c1)实现复制、用函数getr(char *c2)实现倒置。#include#includevoid getx(char *c1);void getr(char *c2);int n;int main(){ char str1[80]; printf("请输入字符串1:"); gets(str1); printf("Enter a integer:"); scan 阅读全文
posted @ 2013-11-20 22:43 罗一 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 三、预习检查:选择正确答案,并简要说明为什么?1) 下面定义结构变量的语句中错误的是 _B__,为什么?答:应该是没有名字A.struct student{ int num; char name[20]; } s;B.struct { int num; char name[20]; } stu;C.struct student{ int num; char name[20]; }; struct student s;D.struct student{ int num; char name[20]; }; struct stu s;2)struct {int x, y; } s[2] = { { 阅读全文
posted @ 2013-11-20 22:20 罗一 阅读(384) 评论(0) 推荐(0) 编辑