题目链接

#include <bits/stdc++.h>

using namespace std;

struct node
{
int data;
struct node *next;
};
int main()
{
int n;
struct node *head,*p;
head = new node;
head -> next = NULL;
scanf("%d",&n);
for(int i = 0; i < n; i ++)
{
p = new node;
p -> next = NULL;
scanf("%d", &p -> data);
p -> next = head -> next;
head -> next = p;
}
for(p = head -> next ; p != NULL; p = p -> next)
{
if(p == head -> next)
printf("%d",p->data);
else
printf(" %d",p->data);
}
printf("\n");
return 0;
}

数据结构实验之链表二:逆序建立链表(SDUT 2117)的更多相关文章

  1. SDUT OJ 数据结构实验之链表二:逆序建立链表

    数据结构实验之链表二:逆序建立链表 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descr ...

  2. SDUT-2117_数据结构实验之链表二:逆序建立链表

    数据结构实验之链表二:逆序建立链表 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 输入整数个数N,再输入N个整数,按照 ...

  3. ZT C语言链表操作(新增单向链表的逆序建立)

    这个不好懂,不如看 转贴:C语言链表基本操作http://www.cnblogs.com/jeanschen/p/3542668.html ZT 链表逆序http://www.cnblogs.com/ ...

  4. C语言链表:逆序建立单链表

    #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<malloc.h> #define LEN sizeof( ...

  5. SDUT OJ 数据结构实验之链表一:顺序建立链表

    数据结构实验之链表一:顺序建立链表 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descr ...

  6. SDUT-2116_数据结构实验之链表一:顺序建立链表

    数据结构实验之链表一:顺序建立链表 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 输入N个整数,按照输入的顺序建立单链 ...

  7. SDUT OJ 数据结构实验之二叉树二:遍历二叉树

    数据结构实验之二叉树二:遍历二叉树 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descr ...

  8. SDUT 3341 数据结构实验之二叉树二:遍历二叉树

    数据结构实验之二叉树二:遍历二叉树 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 已知二叉 ...

  9. SDUT-3441_数据结构实验之二叉树二:遍历二叉树

    数据结构实验之二叉树二:遍历二叉树 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 已知二叉树的一个按先序遍历输入的字符 ...

随机推荐

  1. Linux weblogic启停

    一般weblogic启停在windows下很方便使用图标方式.但是在linux下需要杀掉weblogic进程才能真正关掉weblogic. 1.查询weblogic进程 ps -ef | grep & ...

  2. 怎样写一个 "Hello, World!"

    第一步: 打开浏览器, 按 F12 键或 Ctrl + Shift + J.   注意:  1. 打开的这个界面是浏览器的开发者工具界面. 2. 顶部有许多Tab栏, 如: Elements / Co ...

  3. springboot由于bean加载顺序导致的问题

    先记录现象: dubbo整合zipkin时,我的配置文件是这样的 @Bean("okHttpSender") public OkHttpSenderFactoryBean okHt ...

  4. python 使用三种常用的工具包处理图片

    matplotlib,PIL(Pillow),Opencv三种常用的作图方式. 使用matplotlib画图,很棒,matplotlib 是python最著名的2D绘图库,它提供了一整套和matlab ...

  5. USB设备描述符

    /* USB Standard Device Descriptor */ const u8 Virtual_Com_Port_DeviceDescriptor[] = { 0x12, /* bLeng ...

  6. NVIDIA双显卡

    NVIDIA双显卡 第一步:代码:sudo update-pciids #更新显卡信息非常重要,否则可能识别出错lspci -v | grep -i vga #察看显卡 我的显卡信息如下:代码:00: ...

  7. 【温故知新】php 魔术方法

    <?php class Magic{ private $name; /** *构造方法,在类被实例化时自动调用,一般用于初始化操作 */ public function __construct( ...

  8. JavaSpring【三、Bean】

    配置项 id bean的标识 class bean的类全名 scope bean的作用域 constructor-arg 构造注入 properties 设值注入 autowire 装配模式 lazy ...

  9. Spark集群任务提交流程----2.1.0源码解析

    Spark的应用程序是通过spark-submit提交到Spark集群上运行的,那么spark-submit到底提交了什么,集群是怎样调度运行的,下面一一详解. 0. spark-submit提交任务 ...

  10. Linux内核移植主要过程