岁数不小了,得认真学习了!

07年毕业到现在,三年有多了。蛋疼啊!

从开始的自动化专业,到一年多的中讯对日外包生活,再到失业4个月的无聊生活,再到2个月不到的ruby生活,最终开始了为续到今天的rails生活。依旧是那么的蛋疼。

迷茫,rails在成都发展太慢了。。悲剧。

迷茫,rails到底在企业应用中能否占据市场?

迷茫,年底会不会涨工资啊。现实生活开销太大。

迷茫,26的人了,马上要结婚,生娃了,无房无车无存款。哈哈。

迷茫,近5年的魔兽世界终于抛在了一边,从此不再迷茫了喔。。

开始认真钻研rails了,我还是相信她的。我也会尽自己的能力去把她发扬发扬。


我的未来会是怎样呢~?Rails,我把我的一生押在你上面了~!



Good good study, day day up!!!


哈哈,真够蛋疼的!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
假设学习小组的链表结构体为: ```c typedef struct student { char name[20]; // 姓名 int age; // 年龄 struct student *next; // 指向下一个节点的指针 } Student; ``` 则可以使用以下代码输出学习小组的链表: ```c void printList(Student *head) { Student *current = head; while (current != NULL) { printf("姓名:%s,年龄:%d\n", current->name, current->age); current = current->next; } } ``` 为了按岁数大小输出链表,可以先将链表按年龄从小到大排序,然后再调用 `printList` 函数输出。 一个简单的排序方法是使用冒泡排序,实现代码如下: ```c void sortList(Student *head) { Student *current = head; while (current != NULL) { Student *next = current->next; while (next != NULL) { if (next->age < current->age) { // 交换节点 char tempName[20]; int tempAge; strcpy(tempName, current->name); tempAge = current->age; strcpy(current->name, next->name); current->age = next->age; strcpy(next->name, tempName); next->age = tempAge; } next = next->next; } current = current->next; } } ``` 完整代码示例: ```c #include <stdio.h> #include <string.h> typedef struct student { char name[20]; // 姓名 int age; // 年龄 struct student *next; // 指向下一个节点的指针 } Student; void printList(Student *head) { Student *current = head; while (current != NULL) { printf("姓名:%s,年龄:%d\n", current->name, current->age); current = current->next; } } void sortList(Student *head) { Student *current = head; while (current != NULL) { Student *next = current->next; while (next != NULL) { if (next->age < current->age) { // 交换节点 char tempName[20]; int tempAge; strcpy(tempName, current->name); tempAge = current->age; strcpy(current->name, next->name); current->age = next->age; strcpy(next->name, tempName); next->age = tempAge; } next = next->next; } current = current->next; } } int main() { // 初始化链表 Student student1 = {"小明", 15, NULL}; Student student2 = {"小红", 13, NULL}; Student student3 = {"小刚", 14, NULL}; Student student4 = {"小李", 12, NULL}; student1.next = &student2; student2.next = &student3; student3.next = &student4; printf("未排序前:\n"); printList(&student1); sortList(&student1); printf("排序后:\n"); printList(&student1); return 0; } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值