题目链接

#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;
}

最新文章

  1. struct 大小计算
  2. [javaweb]Java过滤器与包装设计模式的实用案例.
  3. Oracle Merge Into 用法详解
  4. ffmpeg无法接收组播流问题处理
  5. C#_约束 实现可排序单链表
  6. c中计时的几种方法
  7. JAVA的节点流和处理流以及流的关闭顺序
  8. 关于&lt;%@ include file=&quot; &quot; %&gt;与&lt;jsp:include page=&quot;&quot;&gt;&lt;/jsp:include&gt;中的那些问题?
  9. Redis数据类型之List(三)
  10. android studio 目录结构讲解
  11. 记录一次有意思的XSS过滤绕过2
  12. [Swift]LeetCode135. 分发糖果 | Candy
  13. Neutron :默认通过 dnsmasq 实现 DHCP 功能----Namespace
  14. hive 表锁和解锁
  15. gd_t , bd_t 结构分析
  16. code128 C语言实现
  17. 阿里云ECS安装Kubernetes问题收集与解答
  18. 构建BSP (boardsupport packet)
  19. 动态链接库 —— Dll 基础
  20. moment.js使用方法总结

热门文章

  1. MySQL 数据库面试题
  2. 由[].slice.call()引发的思考
  3. Java 并发进阶常见面试题总结
  4. c#本地文件配置xml
  5. 验证组件FluentValidation的使用示例
  6. Marketing Cloud demo环境和API使用方法说明
  7. PHP 求两个日期之间相差的天数、月数
  8. 阿里云Ubuntu下tomcat8.5配置SSL证书
  9. Image Processing and Analysis_8_Edge Detection:Theory of Edge Detection ——1980
  10. 03.Zabbix应用服务监控