C语言-郝斌笔记-002病毒程序示范
病毒程序示范
/*
龌龊的程序!
*/
# 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病毒程序示范的更多相关文章
- C语言-郝斌笔记-007是否为素数
是否为素数 # include <stdio.h> bool IsPrime(int val) { int i; ; i<val; ++i) { ) break; } if (i = ...
- C语言-郝斌笔记-006排序及查找
1. int partion(int *a, int low, int high) { int value = a[low]; int t; while (low < high) { while ...
- C语言-郝斌笔记-005菲波拉契序列
菲波拉契序列 /* 菲波拉契序列 1 2 3 5 8 13 21 34 */ # include <stdio.h> int main(void) { int n; int f1, f2, ...
- C语言-郝斌笔记-004判断是否为回文数
判断是否为回文数 # include <stdio.h> int main(void) { int val; //存放待判断的数字 int m; ; printf("请输入您需要 ...
- C语言-郝斌笔记-003数据类型
基本类型数据 整数 整型 —— int --4字节 短整型 —— short int ——2字节 长整型 —— long int ——8字节 浮点数[实 ...
- C语言-郝斌笔记-001求二次方程的根
求二次方程的根 #include <stdio.h > #include<math.h> int main(void) { //把三个系数保存到计算机中 ; //=不表示相等, ...
- 郝斌老师C语言学习笔记(一)
在给变量分配内存时,很可能这段内存存在以前其他程序使用留下的值.当使用VC编译器,若编译器发现没有给变量赋值而使用,就会返回一个以“85”开头的很大的数字(此时该段内存中为一个垃圾数,为了避免出现较常 ...
- [C]郝斌C语言课程大纲及笔记
本笔记整理于郝斌老师C语言课程,做学习参考之用. 1.[编程笔记]第一章 C语言概述 2.[编程笔记]第二章 C语言预备知识 3.[编程笔记]第三章 运算符与表达式 4.[编程笔记]第四章 流程控制 ...
- # C语言假期学习笔记——6
C语言假期学习笔记--6 数组 主要学习了一位数组和二维数组. 数组是一组具有相同类型的变量的集合.C语言程序通过元素的下标来访问数组中的元素.(下标从0开始) 一位数组 类型 数组名[元素个数] 二 ...
随机推荐
- LeetCode OJ:Combination Sum III(组合之和III)
Find all possible combinations of k numbers that add up to a number n, given that only numbers from ...
- hdu1085 Holding Bin-Laden Captive!(母函数)
简单的母函数应用. #include<iostream> #include<cstdio> #include<cstdlib> #include<cstrin ...
- mxnet(gluon)—— 模型、数据集、损失函数、优化子等类、接口大全
1. 数据集 dataset_train = gluon.data.ArrayDataset(X_train, y_train) data_iter = gluon.data.DataLoader(d ...
- cocos2dx混合模式应用———制作新手引导高亮区域 (2.2.0)
cocos2dx混合模式应用———制作新手引导高亮区域 转自:http://www.cnblogs.com/mrblue/p/3455775.html 首先,效果预览一下 高亮区域的图片: 示例代码: ...
- HDU3727 Jewel(主席树+树状数组(或二分))
Problem Description Jimmy wants to make a special necklace for his girlfriend. He bought many beads ...
- C# Message 消息处理
一.消息概述 Windows下应用程序的执行是通过消息驱动的.消息是整个应用程序的工作引擎,我们需要理解掌握我们使用的编程语言是如何封装消息的原理.C#自定义消息通信往往采用事件驱动的方式实现,但有时 ...
- [转]【技术心得】Last-Modified,Etag,Expire区别
Last-Modified 是什么 Last-Modified 是 HttpHeader 中的资源的最后修改时间,如果带有 Last-Modified ,下一次发送 Http 请求时,将会发生带 If ...
- Ubuntu下部署GitLab-——基于14.04系统
搭建GitLab的目的: 方便公司开发管理代码 GitLab实现的功能: 1.关闭了gitlab的注册功能 2.修改了默认端口 3.汉化 0.前期准备 # 环境 Ubuntu 14.04 root@i ...
- 使用PowerShell在Azure China创建Data Warehouse
微软的Azure Data Warehouse是基于MPP架构的分布式系统: Control Node负责管理系统和接受用户的请求,Compute Node负责计算. 目前在国内Azure Data ...
- HDU1021(模运算)
Fibonacci Again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)T ...