题目链接

#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. Devexpress WinForm TreeList的三种数据绑定方式(DataSource绑定、AppendNode添加节点、VirtualTreeGetChildNodes(虚拟树加载模式))

    第一种:DataSource绑定,这种绑定方式需要设置TreeList的ParentFieldName和KeyFieldName两个属性,这里需要注意的是KeyFieldName的值必须是唯一的. 代 ...

  2. FGL内置函数大全

    内置功能摘要: 内置的功能是什么?内置的功能列表支持的功能列表键代码表另请参阅:效用函数,变量,函数,操作符,内置类. ---------------------------------------- ...

  3. 【hash】Seek the Name, Seek the Fame

    [哈希和哈希表]Seek the Name, Seek the Fame 题目描述 The little cat is so famous, that many couples tramp over ...

  4. 使用 backdoor 工具注入ShellCode

    backdoor-factory 顾名思义,直接翻译过来就是后门工厂的意思.其利用打补丁的方式编码加密PE文件,可以轻松的生成win32PE后门程序,从而帮助我们绕过一些防病毒软件的查杀,达到一定得免 ...

  5. k8s之自定义指标API部署prometheus

    1.自定义指标-prometheus node_exporter是agent;PromQL相当于sql语句来查询数据; k8s-prometheus-adapter:prometheus是不能直接解析 ...

  6. Partial的应用

    Partial是局部类型的意思.允许我们将一个类.结构或接口分成几个部分,分别实现在几个不同的.cs文件中.C#编译器在编译的时候仍会将各个部分的局部类型合并成一个完整的类 局部类型的注意点1. 局部 ...

  7. VS219 没有.net core 3.0模板

    控制台命令 dotnet --info dotnet --version 都正常显示有安装3.0 需要升级VS 2019 16.3.3,本地版本为16.3.2

  8. winfrom_动态添加按钮button(设置颜色,大小,按钮字体大小、颜色,位置,事件)

    List<string> strColor = new List<string>(); strColor.Add("#e67817"); strColor. ...

  9. EFcore的 基础理解<三> 多对多,唯一约束

    唯一约束,替代键. modelBuilder.Entity<Car>() .HasAlternateKey(c => new { c.State, c.LicensePlate }) ...

  10. JavaScript随机验证码

    利用canvas制作一个随机验证码: 1.clearRect:context.clearRect(x,y,width,height);清空给定矩形内的指定像素 2.fillStyle:设置画笔的颜色 ...