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

typedef struct Node
{
int data;
struct Node *next;
}LNode,*LinkList;

void construt(int temp,struct Node *head)
{
struct Node *cycle;
cycle = head;
while(temp--)
{
cycle->next = (struct Node*)malloc(sizeof(struct Node));
cycle = cycle->next;
scanf("%d",&cycle->data);
cycle->next = NULL;
}
cycle->next = head;
}

void output(struct Node *head)
{
struct Node *cycle;
cycle = head;
while(cycle->next != head)
{
printf("%d ",cycle->next->data);
cycle = cycle->next;
}
}
int compear(struct Node *head,int temp)
{
int signal = 0;
struct Node *cycle,*http,*Next;
cycle = head;
while(cycle->next != head)
{
if(cycle->next->data == temp)
{
printf("1\n");
signal = 1;
return 0;
}
cycle = cycle->next;
}
cycle = head;
while(cycle->next != head)
{
if(cycle->next->data > temp)
{
Next = cycle;
cycle = cycle->next;
printf("0\n");
http = (struct Node*)malloc(sizeof(struct Node));
http -> data = temp;
Next -> next = http;
http->next = cycle;
signal = 1;
return 0;
}
Next = cycle;
cycle = cycle->next;
}
http = (struct Node*)malloc(sizeof(struct Node));
http -> data = temp;
http -> next = head;
printf("0\n");
cycle->next = http;
return 0;
}
int main(int argc, char *argv[])
{
int numberOne,numberTwo;
scanf("%d",&numberOne);
struct Node *headA;
struct Node *headB;
struct Node *headC;
headA = (struct Node*)malloc(sizeof(struct Node));
headA->next = NULL;
construt(numberOne,headA);
scanf("%d",&numberTwo);
compear(headA,numberTwo);
output(headA);
}

ACM山东工商 Contest - 软件171-2 第1次测验的更多相关文章

  1. ACM山东工商 数据结构与算法 第3章 双向栈的操作

    #include <stdio.h>#include <stdlib.h> #define SIZE   20//1左 偶 typedef struct hold{ int s ...

  2. ACM山东工商 栈和队列算法练习

    #include <stdio.h>#include <stdlib.h> #define SIZE   20 typedef struct hold{ char sign[S ...

  3. sdut 2162:The Android University ACM Team Selection Contest(第二届山东省省赛原题,模拟题)

    The Android University ACM Team Selection Contest Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里 ...

  4. 标准产品+定制开发:专注打造企业OA、智慧政务云平台——山东森普软件,交付率最高的技术型软件公司

    一.公司简介山东森普信息技术有限公司(以下简称森普软件)是一家专门致力于移动互联网产品.企业管理软件定制开发的技术型企业.公司总部设在全国五大软件园之一的济南齐鲁软件园.森普SimPro是由Simpl ...

  5. [ACM] hdu 5045 Contest (减少国家Dp)

    Contest Problem Description In the ACM International Collegiate Programming Contest, each team consi ...

  6. 2013 Asia acm Hangzhou Regional Contest 杭州现场赛

     B Stealing Harry Potter's Precious 题目大意:给定一个n*m的地图,某些点可以走,某些点可以走某些点不可以走,给定一个起点,又给出了k个点k<=4,要求从起点 ...

  7. 第一章-第四题(ACM 比赛的程序是软件么? “写程序” 和 ”做软件“ 有区别么?软件工程是不是教那些不怎么会写程序的人开发软件? 你怎么看?这个游戏团队, 有很好的软件,但是商业模式和其他软件之外的因素呢?有没有考虑到)--By梁旭晖

    引用 http://baike.baidu.com/link?url=z_phkcEO4_HjFG_Lt163dGFAubdb68IbfcfzWscTOrrZ55WbJEQKzyMQ5eMQKyatD ...

  8. SDUT 2409:The Best Seat in ACM Contest

    The Best Seat in ACM Contest Time Limit: 1000MS Memory limit: 65536K 题目描述 Cainiao is a university st ...

  9. Sdut 2409 The Best Seat in ACM Contest(山东省第三届ACM省赛 H 题)(模拟)

    题目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once ...

随机推荐

  1. .net core webapi 使用ValidationAttribute对比同一对象的多个参数

    众所周知,在使用DataAnnotations数据验证的时候,特别是针对同一个InputDto的多个属性进行对比的时候,例如起始日期不能大于结束日期,我们需要在Attribute中知道当前InputD ...

  2. 搭建本地yum源

    本地yum源其实非常容易搭建 首先进入/etc/yum.repos.d/ 将原来的yum源备份后移除,然后新建dvd.repo: 内容如下: [base] name=base baseurl=file ...

  3. idea 工具中项目文件上有灰色的小X号去除方法

    初使用idea,在项目中发现类上有这样的灰色X号,启动项目后idea会报找不到这个类的错误,原因是它没有被编译, 解决方法 setting->Build->Compiler->Exc ...

  4. Windows挂载NFS共享盘

    Centos7添加NFS方法请见如下链接: https://www.cnblogs.com/jackyzm/p/10285845.html 一:添加NFS服务 1.1:此电脑-右键-管理-window ...

  5. MySQL data sync to Oracle with OGG(Remote Delivery)

    MySQL to Oracle with OGG 1. Install MySQL: yum install mysql-community-server [root@localhost ~]#  y ...

  6. django 模板 (ああああああああ!かぴ)

    一 常用 1. {{ 不存在 | default : "xx" }} 2. {{ name | length }} 3. {{ xx | slice "1:-1" ...

  7. 安装webstrom2019

    破解webstrom2019 下载地址:https://www.jetbrains.com/webstorm/ 下载安装后进行破解(安装基本上是傻瓜样式的) 可以在线进入  http://idea.l ...

  8. 泊爷带你学go -- 反射的经典玩法

    package main import ( "fmt" "reflect" ) type order struct { ordId int customerId ...

  9. 运维脚本while语法

    循环的意思就是让程序重复地执行某些语句; whiler循环就是循环结构的一种,当事先不知道循环该执行多少次,就要用到while循环; while循环语句的运行过程 使用while循环语句时,可以根据特 ...

  10. Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2

    pycharm运行TensorFlow警告:Your CPU supports instructions that this TensorFlow binary was not compiled to ...