【入门爬虫】 import requestsimport reurl = "https://www.tupianzj.com/meinv/mm/leisimao/"html = requests.get(url)#<Response 200>#获取网页真正内容使用content方法html_content = html.content.decode("gbk")#print(html_content)#存放照片链接的地方pic_url_list = []#获取所有图片的链接html
【807】简单处理学生成绩 #include<stdio.h>#define N 10struct student { char stuNum[20]; int math; int c;};void input(struct student *p,int n){ int i; for(i=0;i<n;i++){ printf("plesae input the %d stuNun:",i+1); scanf("%s",p[i].stuNum); printf("Please input
【807】矩阵周长元素之和 #include<stdio.h>#define M 4#define N 5int fun(int a[M][N]){ int sum=0,i,j; for(i=0;i<M;i++) { for(j=0;j<N;j++) { if(i==0||i==M-1) sum+=a[i][j]; else if(j==0||j==N-1) sum+=a[i][j]; } } return sum;}int main(){ in
【807】判断一天是一年中的第几天(包括闰年) #include<stdio.h>struct Date{ int year; int month; int day;};int days(int year,int month,int day);int main(){ struct Date p; scanf("%d,%d,%d",&p.year,&p.month,&p.day); days(p.year,p.month,p.day); return 0;}int days(int year
【807】加减乘 指针 #include<stdio.h>int sum(int a,int b);int minus(int a,int b);int mul(int a,int b);int main(){ int result; int (*p)(int a,int b); int a=3,b=4,n; printf("please choose 1,2or3"); scanf("%d",&n); if(n==1) p=sum; if(n==2) p=minus; i
【807】指向函数的指针 求两数之和 #include<stdio.h>int sum(int a,int b);int main(){ int result; int (*p)(int a,int b)=sum; result=(*p)(1,3); printf("%d",result); return 0;} int sum(int a,int b){ return a+b;}
【807】将一个字符数组中的字符串复制到另一个字符数组中 #include<stdio.h>char *strcopy_(char *str1,char *str2);int main(){ char str1[30],str2[30],*str; gets(str1); gets(str2); str=strcopy_(str1,str2); printf("string is :%s",str); return 0;}char *strcopy_(char *str1,char *str2){ int i; for(
【807】指针输出数组元素 #include<stdio.h>int main(){ int a[5],i,*p; p=a; printf("please input 5 numbers:"); for(i=0;i<5;i++) { scanf("%d",p++); } p=a; for(i=0;i<5;i++) { printf("%d,",*(p++)); } return 0;}
【807】去除字符串中的数字 #include<stdio.h>int main(){ char *str1,*str2; char string[100]; gets(string); for(str1=string,str2=str1;*str1!='\0';) { if(*str1>='0'&&*str1<='9'){ str1++; } else { *str2=*str1; str1++; str2++; } } *str2=
【807】去除字符串中的数字 #include<stdio.h>int main(){ char *str1,*str2; char string[100]; gets(string); for(str1=string,str2=str1;*str1!='\0';) { if(*str1>='0'&&*str1<='9'){ str1++; } else { *str2=*str1; str1++; str2++; } } *str2=
蛇形方阵 三角形周长 11.2 #include<stdio.h>int a[100][100];int main(){ int n,i,j,sum=1; scanf("%d",&n); a[1][1]=1; for(i=1,j=1;sum<n*n;) //此处sum必须严格小于n^2 否则循环无法结束 { while(++j<=n && !a[i][j])a[i][j]=++sum;--j; while(++i<=n && !a[i][j])
【网安学习笔记-Linux基础】 CentOS7安装与配置学习机的常用配置关闭防火墙关闭selinux关闭自动锁屏systemctl stop firewalldsystemctl disable firewalldRemoved symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.#
python面向对象进阶 在了解了面向对象基础之后,我们知道了如何定义类,如何创建对象以及给对象发消息。为了更好使用面向对象思想进行编程开发,需要对python中面向对象编程有更深入的了解。1.@property装饰器2.__slots__魔法3.静态方法和类方法4.类之间的关系5.继承和多态6.综合案例演示@property装饰器之前讨论过python中属性和方法有权限的问题,虽然不建议将属性设为私有,但是直接把属性暴露给外界是有问题的,比如 没有办法检查赋给属性的值是否有效。之间的措施是将属性以单下滑线开头,
python面向对象编程 什么是面向对象?程序中的数据和函数是一个逻辑上的整体,可以称之为对象。解决问题的方式就是创造出需要的对象,并向对象发出消息,多个对象一起工作,各司其职,最终就能构造出复杂的系统来解决现实中的问题。类和对象简言之,类是对象的蓝图和模板,对象是类的实例。类是一个抽象的概念,而对象是具体的东西。面向对象编程的世界中一切皆对象,对象都有属性和行为,每个对象都是独一无二的。我们把拥有共同特征的对象的静态特征(属性)和动态特征(行为)都抽取出来,就可以定义一个叫做“类”的东西。定义一个类class Stud
fakebook writeup sql注入思路 2021.1.20网鼎杯的一道题。习惯性拿到题目先扫目录发现了robots.txt。看到了/user.php.bak这个,应该是源码泄漏。bak文件可以下载到本地,bak是back-up 备份文件,需要改为对应文件名才能打开,这里就把user.php.bak,改为user.php即可。<?phpclass UserInfo{ public $name = ""; public $age = 0; public $blog = ""; publi
攻防世界 Web_python_template_injection wp 2021.1.19今天把两个拖了很久的python模板注入做完了,感觉神清气爽!WP进来后看到了题目的提示,python template injection,看样子是个模板注入,先测试一下。1+1被计算成了2,并回显到页面上,说明存在模板注入,去百度一下template的注入姿势。//调用os模块的popen执行ls打印所有文件{{[].__class__.__base__.__subclasses__()[71].__init__.__globals__['os'].popen("命令"
攻防世界 easytornado wp 2021.1.19不知不觉,1月份都到了19号,感觉一天一道题不太行呀。【狗头】废话不多说,先写题解,再总结知识点。题目名叫easytornado,应该是tornado框架的漏洞。挨个点开看看看到了/flllllllllag这个文件,估计是flag,但是看到了上面的验证逻辑,有个filehash值,按照格式把文件名的hash值搞出来,emmm看格式应该是MD5,但是不对。但是别急,一共给了三个文件夹呢。查看第二个welcome.txt发现了render。百度一波tornado rende
i春秋 百度杯 九月场 SQLi wp 菜鸡日常水题!!2021.1.18SQL注入的无逗号注入SQL注入与HTTP重定向本题目点进去后发现页面一直提示loading…,F12查看源码,发现了坑爹提示这是提示了注入点呀??!测试了各种注入,没啥收获。sqlmap跑一波,也啥都没有。扫一波目录,看到了index.php和robots.txt但是当我们输入index.php的时候,就会自己跳转到另一个页面年少的我懵懂无知,跟本不知道发生了什么,也不知道在意这里。 于是只能查看大佬们的WP了。大佬提示:这个logi