上一页 1 ··· 67 68 69 70 71
摘要: 1 #include<stdio.h> 2 #include<malloc.h> 3 struct stu 4 { 5 int data ; 6 struct stu *next ; 7 }; 8 struct stu *creat(int n) 9 {10 int i;11 struct stu *head,*p,*tail;12 head = (struct stu *)malloc(sizeof(struct stu));13 head->next = NULL;14 tail = head; 15 for(i = 1 ... 阅读全文
posted @ 2012-02-10 17:03 _雨 阅读(427) 评论(0) 推荐(0) 编辑
摘要: 指针做参数传递写出下面的函数,实现计算字符串长,字符串复制功能int strlen(char *s)void strcpy( char *s, char *t)贴出你的代码 1 #include<stdio.h> 2 int strlen(char *s) 3 { 4 int n = 0; 5 while(*s++!='\0') 6 { 7 n++; 8 } 9 return n;10 }11 void strcpy( char *s, char *t)12 {13 while((*t++=*s++)!='\0');14 }15 ... 阅读全文
posted @ 2012-02-10 17:00 _雨 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 结构体作1.定义一个acmer结构体,包括以下信息:姓名,学号,手机号,做题数,出生日期,其中出生日期date也是一个结构体,包括年、月、日2.建立结构体数组,实现对多个同学的信息输入,输出3.实现简单的统计功能,比如统计做题数大于150的同学并输出其完整信息4.实现查找功能,包括按姓名、学号查找5.实现信息修改功能6.按做题数目进行排序(选作)7.其他功能可以自由扩展,多多益善 ^_^8.程序一个函数实现一个功能9.代码测试成功后贴在论坛上,大家互相学习借鉴 1 #include<stdio.h> 2 #include<string.h> 3 struct data 阅读全文
posted @ 2012-02-09 16:01 _雨 阅读(627) 评论(0) 推荐(0) 编辑
摘要: 题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1048The Hardest Problem Ever 1 #include<iostream.h> 2 #include<string.h> 3 int main() 4 { 5 int i, k, n ; 6 char x,c[201], s[20], d[4], h[11]={"ENDOFINPUT"} ; 7 while(cin.getline(c, 200) ) 8 { 9 if(strcmp(c,h) == 0)10 ... 阅读全文
posted @ 2012-02-04 14:40 _雨 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1013Digital Roots 1 #include<iostream> 2 #include<string> 3 using namespace std; 4 int devide(int n) 5 { 6 int s = 0 ; 7 while(n) 8 { 9 s = s+n%10 ;10 n = n/10 ;11 }12 return s ;13 }14 int main()15 {16 int s ;17 ... 阅读全文
posted @ 2012-02-04 14:37 _雨 阅读(283) 评论(0) 推荐(0) 编辑
上一页 1 ··· 67 68 69 70 71