zoukankan      html  css  js  c++  java
  • tmp0000

    #include <stdlib.h>
    #include <stdio.h>

    int num;

    typedef struct a
    {
    int name[60];
    int gold;
    int sliver;
    int bronze;
    ListNode list;
    }infoss;

    int maxGI, maxGV;
    int MaxSI, maxSV;
    int MaxBI, maxBV;

    infoss info [20];

    struct ListNode
    {
    int val;
    ListNode *next;
    };

    struct ListNode ghead;

    struct ListNode* insertionSortList(struct ListNode* head) {
     
    if(head == NULL) return head;
     
    struct ListNode *dummy= (struct ListNode *)malloc(sizeof(struct ListNode));
    dummy->next=NULL; //new start of the sorted list
     
    struct ListNode *pre=dummy; //insert node between pre and pre.next
    struct ListNode *cur=head; //the node will be inserted
    struct ListNode *Next=NULL; //the next node will be inserted
     
    while(cur != NULL)
    {
    Next=cur->next;
    //find the right place to insert
    while(pre->next != NULL && pre->next->val < cur->val)
    {
    pre=pre->next;
    }
    //insert between pre and pre.next
    cur->next=pre->next;
    pre->next=cur;
     
    pre=dummy;
    cur=Next;
    }
     
    return dummy->next;
    }


    int main(int argc, char const *argv[])
    {
    scanf("%d", &num);

    int i;
    for (i=0; i<num; i++)
    {
    scanf("%s %d %d",&info[i].name, &info[i].gold, &info[i].sliver, &info[i].bronze);
    printf("lcm debug in %s %d %d %d",info[i].name, info[i].gold, info[i].sliver, info[i].bronze);
    if (info[i].gold > maxGV)
    {
     
    }
    }

    for (i=0; i<num; i++)
    {

    }

    }
  • 相关阅读:
    正则表达式-汉字的匹配方法
    python 正则匹配中文(unicode)(转)
    Notepad++ 快捷键 大全
    gvim 编辑器配置
    gvim代码补全
    UNICODE,GBK,UTF-8区别
    AJAX
    day 75 中间件
    Cookie和Session 装饰器的修复技术
    必知必会13条 单表查询之双下划线 ForeignKey操作 ManyToManyField 聚合分组
  • 原文地址:https://www.cnblogs.com/aerfa828/p/11530814.html
Copyright © 2011-2022 走看看