病毒程序示范

 /*
龌龊的程序!
*/
# include <stdio.h>
# include <windows.h>
# include <malloc.h>
#include<cstdlib> int main(void)
{
int c;
int i;
int j; Nihao:
printf("1:死机\n");
printf("2:机房爆炸\n");
printf("请选择:\n"); scanf("%d,&c"); if (c ==)
{
system("shutdown -s -t 60");
}
else if ( == c)
{
printf("你太坏了 我要惩罚你!\n");
for (j=;j<;++j){
system("start");
}
}
else
{
printf("你敲错了,请重新输入!\n");
goto Nihao;
}
return ;
}

内存泄露(占满内存)程序导致死机实例

 #include < stdio.h > #include < malloc.h >

     int main(void) {
while () {
int * p = (int * ) malloc();
}
return ;
}

C语言-郝斌笔记-002病毒程序示范的更多相关文章

  1. C语言-郝斌笔记-007是否为素数

    是否为素数 # include <stdio.h> bool IsPrime(int val) { int i; ; i<val; ++i) { ) break; } if (i = ...

  2. C语言-郝斌笔记-006排序及查找

    1. int partion(int *a, int low, int high) { int value = a[low]; int t; while (low < high) { while ...

  3. C语言-郝斌笔记-005菲波拉契序列

    菲波拉契序列 /* 菲波拉契序列 1 2 3 5 8 13 21 34 */ # include <stdio.h> int main(void) { int n; int f1, f2, ...

  4. C语言-郝斌笔记-004判断是否为回文数

    判断是否为回文数 # include <stdio.h> int main(void) { int val; //存放待判断的数字 int m; ; printf("请输入您需要 ...

  5. C语言-郝斌笔记-003数据类型

    基本类型数据 整数 整型     —— int      --4字节  短整型   —— short int   ——2字节 长整型   —— long int    ——8字节      浮点数[实 ...

  6. C语言-郝斌笔记-001求二次方程的根

    求二次方程的根 #include <stdio.h > #include<math.h> int main(void) { //把三个系数保存到计算机中 ; //=不表示相等, ...

  7. 郝斌老师C语言学习笔记(一)

    在给变量分配内存时,很可能这段内存存在以前其他程序使用留下的值.当使用VC编译器,若编译器发现没有给变量赋值而使用,就会返回一个以“85”开头的很大的数字(此时该段内存中为一个垃圾数,为了避免出现较常 ...

  8. [C]郝斌C语言课程大纲及笔记

    本笔记整理于郝斌老师C语言课程,做学习参考之用. 1.[编程笔记]第一章 C语言概述 2.[编程笔记]第二章 C语言预备知识 3.[编程笔记]第三章 运算符与表达式 4.[编程笔记]第四章 流程控制 ...

  9. # C语言假期学习笔记——6

    C语言假期学习笔记--6 数组 主要学习了一位数组和二维数组. 数组是一组具有相同类型的变量的集合.C语言程序通过元素的下标来访问数组中的元素.(下标从0开始) 一位数组 类型 数组名[元素个数] 二 ...

随机推荐

  1. 项目管理理论与实践(6)——利用Excel制作项目文档的设计技巧

    这篇是使用的Excel 2007 进行文档设计,Excel的设计也是一门学问,这里主要介绍一些Excel的设计技巧,后面也会陆续更新该文章. 1. 固定某行某列 首先设计这样的任务管理文档: 现在我想 ...

  2. java学习笔记 --- IO(3)

    1.FileReader:读取字符流,默认GBK public class CharStreamDemo { public static void main(String[] args) throws ...

  3. bzoj4513 储能表

    求 $\sum\limits_{i=0}^{n-1} \sum\limits_{j=0}^{m-1} max((x \space xor \space j) - k,0)$ ,膜 $p$ $n,m \ ...

  4. UVA - 1343 The Rotation Game (BFS/IDA*)

    题目链接 紫书例题. 首先附上我第一次bfs+剪枝TLE的版本: #include<bits/stdc++.h> using namespace std; typedef long lon ...

  5. 使用sort&awk实现文件内容块排序

    源文件为: [root@luo5 wangxx]# cat -v luo.txt J LuoSoutth jfsaNanjing,china Y ZhangVictory UniversityNejf ...

  6. hadoop-hive学习笔记

    create table hive_1(id string,name string ,gender string)row format delimited fields terminated by ' ...

  7. python 集合和深浅copy

    #1数据类型的补充#2.集合set#3.深浅copy 补充:str --> bytes s.encode('gbk')bytes --> str s.decode('gbk') 1.数据类 ...

  8. Azure VM开启资源监控

    目前China的Azure VM资源监控默认是不打开的.本文将介绍如何开启VM的监控功能. 一 Azure VM 打开Azure的Portal页面https://portal.azure.cn,登录后 ...

  9. el表达式对js方法的传值

    我常用于在jsp页面遍历集合和分页中的页面跳转事件. jsp: <!-- 引入jstl --> <%@ taglib prefix="c" uri="h ...

  10. 1 ignite核心特性

    1 Ignite是什么? Apache Ignite是一个以内存为中心的分布式数据库.缓存和处理平台,支持事务.分析以及流式负载,可以在PB级数据上享有内存级的性能. 2 Ignite是不是内存数据库 ...