题目链接

#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;
while(~scanf("%d", &n))
{
if(n == -1)
break;
p = new node;
p -> next = NULL;
p -> data = n;
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 2118)的更多相关文章

  1. 数据结构实验之图论三:判断可达性(SDUT 2138)(简单DFS)

    #include <bits/stdc++.h> using namespace std; int gra[1002][1005]; int vis[1002]; int n,m; voi ...

  2. 数据结构实验之二叉树三:统计叶子数 SDUT 3342

    #include <stdio.h> #include <string.h> struct node { char data; struct node *l,*r; }; st ...

  3. SDUT-3347_数据结构实验之数组三:快速转置

    数据结构实验之数组三:快速转置 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 转置运算是一种最简单的矩阵运算,对于一个 ...

  4. SDUT 3311 数据结构实验之串三:KMP应用

    数据结构实验之串三:KMP应用 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 有n个小朋友 ...

  5. SDUT 3347 数据结构实验之数组三:快速转置

    数据结构实验之数组三:快速转置 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 转置运算是一 ...

  6. SDUT OJ 数据结构实验之二叉树三:统计叶子数

    数据结构实验之二叉树三:统计叶子数 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descr ...

  7. SDUT OJ 数据结构实验之串三:KMP应用

    数据结构实验之串三:KMP应用 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descrip ...

  8. SDUT OJ 数据结构实验之排序三:bucket sort

    数据结构实验之排序三:bucket sort Time Limit: 250 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem D ...

  9. SDUT 3400 数据结构实验之排序三:bucket sort

    数据结构实验之排序三:bucket sort Time Limit: 150MS Memory Limit: 65536KB Submit Statistic Problem Description ...

  10. SDUT 3375 数据结构实验之查找三:树的种类统计

    数据结构实验之查找三:树的种类统计 Time Limit: 400MS Memory Limit: 65536KB Submit Statistic Problem Description 随着卫星成 ...

随机推荐

  1. Python 第二式

    @Codewars Python练习 question ** Simple transposition ** Simple transposition is a basic and simple cr ...

  2. XPath库详解

    目录 xpath入门 获取节点 获取所有节点 获取子节点 获取父节点 属性匹配 根据属性值匹配节点 属性多值匹配 多属性匹配 文本获取 按序选择 节点轴选择 补充 xpath的运算符介绍 xpath轴 ...

  3. xtrabackup原理,整库,单表,部分备份恢复

    物理备份xtrabackup原理 Percona XtraBackup(简称PXB)是 Percona 公司开发的一个用于 MySQL 数据库物理热备的备份工具,支持 MySQl(Oracle).Pe ...

  4. javascript——onsubmit和onreset事件 和开发中常用的方式

    <head> <meta charset="UTF-8"> <title></title> <script> funct ...

  5. StoneTab标签页CAD插件 3.2.0

    //////////////////////////////////////////////////////////////////////////////////////////////////// ...

  6. C# 批量设置窗体中控件状态的方法

    在开发中常遇到当点击某个按钮的时候,禁用文本框或按钮的的状态,以防止误操作,下面的代码是我已批量设置指定控件中的按钮状态的代码,同理可以延伸出很多操作. /// <summary> /// ...

  7. 使用 pdb 进行调试

    使用 pdb 进行调试 pdb 是 python 自带的一个包,为 python 程序提供了一种交互的源代码调试功能,主要特性包括设置断点.单步调试.进入函数调试.查看当前代码.查看栈片段.动态改变变 ...

  8. JTree实现QQ好友列表

    最近学习了一下JTree的使用方法: 先来看一下树的实例: 构建一个树, DefaultMutableTreeNode root = new DefaultMutableTreeNode(" ...

  9. Spring Cloud(二)服务提供者 Eureka + 服务消费者(rest + Ribbon)

    Ribbon是什么? Ribbon是Netflix发布的开源项目,主要功能是提供客户端的软件负载均衡算法,将Netflix的中间层服务连接在一起.Ribbon客户端组件提供一系列完善的配置项如连接超时 ...

  10. Centos 6.5 版本的下载教程

    1.CentOS下载CentOS是免费版,推荐在官网上直接下载,网址:https://www.centos.org/download/ 2.选择版本推荐6.5 3.选择isos 4.根据系统电脑的配置 ...