自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(122)
  • 收藏
  • 关注

原创 web前端

Web 前端1.综述1.1 html超文本标记语言是一种用于创建网页的标准标记语言。HTML是一种基础技术,常用于设计网页、网页应用程序以及移动应用程序的用户界面。网页浏览器可以读取HTML文件,并将其渲染成可视化网页。是一种标记语言。1.2 css层叠样式表(css, 又称串样式列表、级联样式表、串接样式表、阶层式样式表)是一种用来为结构化文档(如HTML文档或XML应用)添加样式(字体、间距和颜色等)的标记语言1.3 javascriptJavaScript是一种高级的、解释型的编程语言。

2020-09-16 22:52:52 433

原创 本地存储coredata和realm

软件产品的两种形态client-server,客户端,本地存储用的较多browser-server,网站,服务器存储用的多,例如mysqlIOS本地存储数据库userdefaults 存储轻量级数据core data 学习成本高,代码较多,速度没有realm快realm 第三方功能包realm// 定义模型的做法和定义常规 Swift 类的做法类似,需要继承class Dog: Object { @objc dynamic var name = "" @objc d

2020-07-04 21:52:11 509

原创 Swift IOS Project Todos App

项目概括制作一个仿任务清单的App,主要为了练习TableViewController。TableViewController的基本使用Todos cell 设置新建一个类继承UITableViewCell,链接类和对象,设置cell的identifierclass TodoCell: UITableViewCell { @IBOutlet weak var checkMark: UILabel! @IBOutlet weak var todo: UILabel! o

2020-07-03 21:45:10 211

原创 12. Swift Inheritance

OverridingTo override a characteristic that would otherwise be inherited, you prefix your overriding definition with the override keyword.class Vehicle { var currentSpeed = 0.0 var description: String { return "traveling at \(currentSpe

2020-07-03 10:01:14 122

原创 11. Swift Methods

Modifying Value Types From Instance MethodsStructures and enumerations are value types. By default, the properties of a value type cannot be modified from within its instance methods.However, if you need to modify the properties of your structure or enu

2020-07-03 08:59:08 327

原创 10. Swift Properties

Stored PropertiesIn its simplest form, a stored property is a constant or variable that is stored as part of an instance of a particular class or structure. Stored properties can be either variable stored properties or constant stored properties.Stored

2020-07-03 08:40:25 347

原创 9. Swift Structures and Classes

Definition SyntaxHere’s an example of a structure definition and a class definition:struct Resolution { var width = 0 var height = 0}class VideoMode { var resolution = Resolution() var interlaced = false var frameRate = 0.0 va

2020-07-01 08:54:54 158

原创 8. Swift Enumerations

An enumeration defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code.Enumeration SyntaxYou create a new enumeration with the enum keyword, and place their entire definition wi.

2020-07-01 08:20:32 141

原创 7. Swift Closures

ClosuresClosures can capture and store references to the constants and variables from the context that defines the closures. This is known as closing over those constants and variables.Closures have three forms:Global functions are closures that hav

2020-06-30 15:00:23 185

原创 Swift Functions

Defining and Calling Functionsyou can define one or more named, typed values that the function takes as input, known as parameters.you can define one type that the function will pass back as output, known as return type.func greet(person: String) -&gt

2020-05-22 21:42:21 693

原创 java io stream

binary file inputFileInputStreamBufferedInputStreamInputStream in = new BufferedInputStream (new FileInputStream (fileName));byte[] data = new byte[1024];int length = in.read(data);read() returns length of binary number it gets and save the number

2020-05-22 19:43:42 157

原创 use eclipse to link to MySQL on macOS

1.project -> build path -> add external archives -> mysql-connector-java-5.1.49.jaryou can download this pakage fromhttps://dev.mysql.com/downloads/workbench/package jdbcProject;import java.sql.*;public class mySql { public stat.

2020-05-22 19:42:38 142

原创 Swift Control Flow

For-In Loopsyou can use the for-in loop to iterate over a sequence, such as items in an array, characters in an stringlet names = ["Anna", "Alex", "Brian", "Jack"]for name in names { print("hello \(name)")}you can use the for-in loop to iterate o

2020-05-19 21:59:52 337

原创 Words Learned From Swift Documentations

fundamental adj. 基本的textual adj. 文本的extensive adj. 广泛的swift makes extensive uses of variables whose values can't be changed.constant n. 常量constants in swift are much more powerful than constants in C.intent n. 意图constants are used throughout swift .

2020-05-19 20:13:53 276

原创 Swift The Basics

some notes while reading the part of basics of swift documentationi want to learn swift and improve my ability to read development documentation by writing this note everydayswift documentation linkchinese version of swift documentation https://swiftgg

2020-05-19 20:12:21 202

原创 Swift Basic Operators

assignment operatorit the right side of a assignment operator is a tuple with multiple values, you can decompose its elements into multiple constants or variableslet (x, y) = (1, 2)the assignment operator does not return a valuearithmetic operator

2020-05-19 20:09:21 152

原创 Swift Strings and Characters

multiline string literalsif you need a string that spans several lines, use a multiline string literal that is a sequence of characters surrounded by 3 double quotation markslet quotation = """to be or not to bethat's a question"""multiline stri

2020-05-19 20:08:13 546

原创 Swift Collection Types

Collection TypesSwift provides three primary collections, known as Array, Set, and DictionaryArrays store values of the same type in a ordered listSets are unordered colletions of unique valuesDictionarys are unordered collections of key-value associa

2020-05-19 20:05:54 234

原创 全排

void totalSort(int x){ if (如果x满足条件) //排完一次后验证是否满足条件 { if 满足条件 执行相应操作 } if (x不满足条件) { for(遍历数组) if(数组的某一点没有被标记) { 标记这一点 给数组赋值 totalSort(x+1) 执行下一位的排数 ...

2019-03-15 13:18:35 313

原创 range 函数

range 函数常用来和for 循环一起使用。 range 函数可以用来产生一个等差数列,如果m n是整数,并且m<n,那么range(m,n)会产生一系列整数m,m+1,m+2,…,n-1。也就是说,序列开始于m,重复加一,直到加到n-1为止。函数range(0,n) 能够被简写为 range(n)例如:for num in range(m,n): indented block o...

2019-03-02 18:07:33 8580

原创 循环结构

while 循环当条件为真时,重复执行一个缩进的语句块while condition: indented block of statements在开始循环之前先判断一次条件,如果条件为假,则直接跳过循环执行后面的语句,如果条件为真,循环体将被执行,每次循环体被执行完之后,会重新检验条件是否为真。也就是,循环体将执行到条件为False的时候才终止。for 循环for var in se...

2019-03-02 14:32:15 191

原创 PTA 乙级 1095 解码PAT准考证

完结撒花!!下学期学过数据结构后会把甲级题目写掉。#include<stdio.h>#include<stdlib.h>#include<math.h>typedef struct{ int classroom, date, idnum, score, cnt; char rank, allnum[14];}information;int...

2019-02-18 15:53:01 394

原创 PTA 乙级 1094 谷歌的招聘

#include<stdio.h>#include<string.h>#include<math.h>int isPrime(int num){ if (num == 1) return 0; for (int i = 2; i <= sqrt(num); i++) if (num%i == 0) return 0; retu...

2019-02-18 13:43:19 344

原创 PTA 乙级 1093 字符串A+B

#include<stdio.h>#include<stdlib.h>#include<string.h>#define X 1000001int main(){ char *str1 = (char*)malloc(sizeof(char)*X), *str2 = (char*)malloc(sizeof(char)*X); int word[...

2019-02-18 13:23:02 262

原创 PTA 乙级 1092 最好吃的月饼

#include<stdio.h>#include<stdlib.h>int main(){ int M, N; scanf("%d %d", &N, &M); int **array = (int**)malloc(sizeof(int*)*M); for (int i = 0; i < M; i++) array[i] = ...

2019-02-18 13:06:28 259

原创 PTA 乙级 1091 N-自守数

#include<stdio.h>#include<math.h>int main(){ int M; scanf("%d", &M); for (int i = 0; i < M; i++) { int K, N, cnt = 0, num, flag = 0; scanf("%d", &K); num = K * K;...

2019-02-18 12:57:09 253

原创 PTA 乙级 1090 危险品装箱

利用数组来记录次数,再用次数动态分配数组是很关键的一点,如果直接用typedef struct{ int array[10000], cnt;}struction2;就会内存不足。就这么简单的一个方法我想了3个小时,可以说是很自闭了…#include<stdio.h>#include<stdlib.h>typedef struct{ int t1, ...

2019-02-17 21:21:47 347

原创 PTA 乙级 1089 狼人杀-简单版

假设两个人是狼,然后遍历对话,如果一个人说谎有两种情况:1.说狼是好人。2.说好人是狼。如果恰好有两个人说谎,并且恰好一个是狼一个是好人,就输出然后结束。代码实现:#include<stdio.h>#include<stdlib.h>#include<math.h>int main(){ int N, *array, *assump; sca...

2019-02-17 18:50:12 383

原创 PTA 乙级 1088 三人行

代码实现:#include<stdio.h>#include<math.h>void cmp(int m, double n){ if (m > n) printf("Gai"); else if (m == n) printf("Ping"); else printf("Cong");}int main(){ int M, X, Y...

2019-02-16 16:39:50 306

原创 PTA 乙级 1087 有多少不同的值

代码实现:#include<stdio.h>#include<stdlib.h>int main(){ int N, *array = (int*)malloc(sizeof(int) * 10334), cnt = 0; scanf("%d", &N); for (int i = 0; i < 10334; i++) array[i] ...

2019-02-16 16:20:10 179

原创 PTA 乙级 1086 就不告诉你

代码实现:#include<stdio.h>int main(void){ int A, B, Tresult, Rresult; scanf("%d %d", &A, &B); Tresult = A * B; if (Tresult >= 10) { Rresult = Tresult % 10; Tresult /= 10; ...

2019-02-16 16:16:06 602

原创 PTA 乙级 1085 PAT单位排行

代码实现:#include<stdio.h>#include<stdlib.h>#include<string.h>typedef struct{ char school[10]; int B, A, T, student, sum, rank;}score;int cmp_school(const void *a, const void *...

2019-02-16 16:11:43 209

原创 PTA 乙级 1084 外观数列

代码实现:#include<stdio.h>#include<string.h>int main(){ int d, N; char str[100000]; scanf("%d %d", &d, &N); str[0] = d + '0'; str[1] = 0; for (int i = 1; i &am

2019-02-16 13:05:04 224

原创 PTA 乙级 1083 是否存在相等的差

代码实现:#include<stdio.h>#include<stdlib.h>#include<math.h>typedef struct{ int number, cnt;}diff;int cmp(const void *a, const void *b){ diff *aa = (diff*)a, *bb = (diff*)b;...

2019-02-16 13:05:00 208

原创 PTA 乙级 1082 射击比赛

代码实现:#include<stdio.h>#include<math.h>int main(){ int N, max_index = 0, min_index = 0; double array[10000]; scanf("%d", &N); for (int i = 0; i < 10000; i++) ar

2019-02-16 13:04:53 332

原创 PTA 乙级 1081 检查密码

代码实现:#include<stdio.h>#include<string.h>int main(){ int N; scanf("%d", &N); getchar(); for (int i = 0; i < N; i++) { char pw[81]; int flag_wrong = 0, flag_number = 0, ...

2019-02-15 21:08:22 404

原创 bsearch()快搜函数

void *bsearch(const void *key, const void *base, size_t nelem, size_t width, int(*fcmp)(const void *, const void *));一共5个参数:1.要寻找的数据的地址2.数组首地址3.数组长度4.数组每个元素的字节数5.比较函数注意:bsearch()函数使用前,数组一定要是排好序...

2019-02-15 19:14:38 306

原创 PTA 乙级 1080 MOOC期终成绩

如果不借助bsearch()函数实在不会做到全对…不借助快搜函数(超时一个测试点):#include<stdio.h>#include<stdlib.h>#include<string.h>typedef struct{ char name[25]; int p, m, f, sum;}grade;int cmp(const void *a...

2019-02-15 19:11:13 245

原创 PTA 乙级 1079 延迟的回文数

代码实现:#include<stdio.h>#include<string.h>#define X 1010void summation(char *num1, char *num2){ int len1 = strlen(num1), len2 = strlen(num2), len = X - 1; char result[X] = { 0 }; f...

2019-02-15 18:34:25 274

原创 PTA 乙级 1078 字符串压缩与解压

代码实现:#include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ char ch, *str = (char*)malloc(sizeof(char) * 1100000); int count = 0; scanf("%c", &ch); getchar();...

2019-02-15 17:50:50 301

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除