tmp0000

桃扇骨 2023-08-17 15:21 183阅读 0赞

#include

#include

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++)

{

}

}

转载于:https://www.cnblogs.com/aerfa828/p/11530814.html

发表评论

表情:
评论列表 (有 0 条评论,183人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Python每天一题 0000

    开学了,也继续写博客了,暑假期间也写了很多笔记。有空再复习下写在博客上。 很喜欢这个每天一题的~~~ 如有错误,请大牛指出,谢谢。 第一天是对图片的操作,那么就安装

    相关 tmp

    一、应用程序、库、内核、驱动程序的关系。 库给应用程序提供的open,read,write,ioctl,mmap等接口函数被称为系统调用,它们设置好相关寄存器之后,执行某条

    相关 笔试题总结0000

    1.选一个正确的(A)(此题答案不知道是不是正确的,希望各位指正) > A静态链接库不能有同名全局函数 > B动态链接库不能有同名全局函数 > C两个静态链