当前位置: 首页 > news >正文

vs2013做简单的网站爱站seo查询

vs2013做简单的网站,爱站seo查询,好看的网站案例,做细分领域的同城网站一.前言 嗨嗨嗨&#xff0c;又和大家见面了&#xff01;前面我们讲到了如何实现一个循序表。现在我们开始讲解如何基于循序表来实现通讯录功能。 二.正文 通讯录中的SeqlList.h #pragma once //#define SLDateType int #include<stdio.h> #include<stdlib.h> #…

一.前言

嗨嗨嗨,又和大家见面了!前面我们讲到了如何实现一个循序表。现在我们开始讲解如何基于循序表来实现通讯录功能。

二.正文

通讯录中的SeqlList.h

#pragma once
//#define SLDateType int
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include"Contact.h"
typedef PerInfo SLDateType;//通讯录中SeqList.h与顺序表中SeqList.h的区别只是在通讯录中将int换成了结构体PerInfo
typedef struct SeqList
{SLDateType* arr;int size;int capacity;
}SL;
void SLInit();//循序表的初始化
void SLDestroy();//顺序表的销毁
void SLPushBack();//尾部插入
void SLPushFront();//头部插入
void SLPopBack();//尾部删除
void SLPopFront();//头部删除
void SLInsert();//指定位置插入
void SLErase();//指定位置删除
int SLFind();//查找数据

通讯录中的Contact.h

#pragma once
#define NAME_MAX 20
#define GENDER_MAX 20
#define TEL_MAX 20
#define ADDR_MAX 20
typedef struct PersonInfo
{char name[NAME_MAX];char gender[GENDER_MAX];int age;char tel[TEL_MAX];char addr[ADDR_MAX];
}PerInfo;
typedef struct SeqList Contact;
void ContactInit(Contact* con);//通讯录的初始化
void ContactDestroy();//通讯录的销毁
void ContactAdd();//通讯录添加数据
void ContactDel();//通讯录删除数据
void ContactModify();//通讯录修改数据
int ContactFind();//通讯录查找数据
void ContactShow();//通讯录展示数据

通讯录中的SeqList.c

#include"SeqList.h"
void SLInit(SL* ps)//循序表的初始化函数的实现
{ps->arr = NULL;ps->size = ps->capacity = 0;
}
void SLDestroy(SL* ps)//顺序表销毁的函数实现
{if ((ps->arr) != NULL){free(ps->arr);}ps->arr = NULL;ps->size = ps->capacity = 0;
}
void SLCheckCapacity(SL* ps)
{if (ps->capacity == ps->size){int NewCapacity = ps->capacity == 0 ? 6 : 2 * ps->capacity;SLDateType* tmp = (SLDateType*)realloc(ps->arr, NewCapacity * sizeof(SLDateType));if (tmp == NULL){perror("realloc faile!");return ;}ps->arr = tmp;ps->capacity = NewCapacity;}}
//void SLPrint(SL* ps)
//{
//	for (int i = 0; i < ps->size; i++)
//	{
//		printf("%d ", ps->arr[i]);
//	}
//	printf("\n");
//}
//void SLPrint(SL s)
//{
//	for (int i = 0; i <s .size; i++)
//	{
//		printf("%d ", s.arr[i]);
//	}
//	printf("\n");
//}
void SLPushBack(SL* ps, SLDateType x)//尾插函数的实现
{assert(ps);SLCheckCapacity(ps);ps->arr[ps->size] = x;ps->size++;
}
void SLPushFront(SL* ps, SLDateType x)//头插函数的实现
{assert(ps);SLCheckCapacity(ps);for (int i = ps->size; i > 0; i--){ps->arr[i] = ps->arr[i - 1];}ps->arr[0] = x;ps->size++;
}
void SLPopBack(SL* ps)//尾删函数的实现
{assert(ps);assert(ps->size);ps->size--;
}
void SLPopFront(SL* ps)//头删函数的实现
{for (int i = 0; i < (ps->size) - 1; i++){ps->arr[i] = ps->arr[i + 1];}ps->size--;
}
void SLInsert(SL* ps, int pos, SLDateType x)//指定位置的插入
{assert(ps);assert(pos >= 0 && pos <= ps->size);SLCheckCapacity(ps);for (int i = ps->size; i >= pos + 1; i--){ps->arr[i] = ps->arr[i - 1];}ps->arr[pos] = x;ps->size++;
}
void SLErase(SL* ps, int pos)
{assert(ps);assert(pos >= 0 && pos < ps->size);for (int i = pos; i <= ps->size - 2; i++){ps->arr[i] = ps->arr[i + 1];}ps->size--;
}
//int SLFind(SL* ps, SLDateType x)
//{
//	assert(ps);
//	for (int i = 0; i <ps-> size; i++)
//	{
//		if (ps->arr[i] ==x)
//		{
//			return i;
//		}
//	}
//	return -1;
//}

通讯录中的Contact.c

#define _CRT_SECURE_NO_WARNINGS
#include"SeqList.h"
#include"SeqList.h"
#include"Contact.h"
#include<string.h>
void ContactInit(Contact* con)
{SLInit(con);}
void ContactDestroy(Contact* con)
{SLDestroy(con);
}void ContactAdd(Contact* con)
{PerInfo pf;printf("请输入用户的姓名\n");scanf("%s", pf.name);printf("请输入用户的性别\n");scanf("%s", pf.gender);printf("请输入用户的年龄\n");scanf("%d", &pf.age);printf("请输入用户的电话\n");scanf("%s", pf.tel);printf("请输入用户的地址\n");scanf("%s", pf.addr);SLPushBack(con, pf);
}int ContactFind(Contact* con,char name[]){for (int i = 0; i < con->size; i++){if (0==strcmp(con->arr[i].name, name)){return i;}}return -1;}void ContactDel(Contact* con){char name[NAME_MAX];printf("请输入你要删除的联系人姓名\n");scanf("%s", name);int find = ContactFind(con, name);if (find < 0){printf("没有找到该联系人\n");ContactShow(con);return;}else{SLErase(con, find);printf("删除成功\n");return;}}void ContactShow(Contact* con){printf("姓名  ");printf("性别  ");printf("年龄  ");printf("电话  ");printf("地址  ");printf("\n");for (int i = 0; i < con->size; i++){printf("%s ",con->arr[i].name);printf("%s ", con->arr[i].gender);printf("%d ", con->arr[i].age);printf("%s ", con->arr[i].tel);printf("%s ", con->arr[i].addr);printf("\n");}}void ContactModify(Contact* con){char name[NAME_MAX];printf("输入要修改人姓名\n");scanf("%s", name);int find = ContactFind(con, name);if (find < 0){printf("要修改的联系人数据不存在!\n");ContactShow(con);return;}//直接修改printf("请输入新的姓名:\n");scanf("%s", con->arr[find].name);printf("请输入新的性别:\n");scanf("%s", con->arr[find].gender);printf("请输入新的年龄:\n");scanf("%d", &con->arr[find].age);printf("请输入新的电话:\n");scanf("%s", con->arr[find].tel);printf("请输入新的住址:\n");scanf("%s", con->arr[find].addr);printf("修改成功!\n");}

测试通讯录功能test.c

//#define _CRT_SECURE_NO_WARNINGS
#include"SeqList.h"
#include"Contact.h"
int main()
{//SL sl;//SLInit(&sl);//SLPushBack(&sl, 0);//SLPushBack(&sl, 1);//SLPushBack(&sl, 2);//SLPushBack(&sl, 3);//SLPushFront(&sl, 3);
//	SLPushFront(&sl, 4);//SLPopBack(&sl);
//	SLPopFront(&sl);// SLInsert(&sl, 3, 99);//SLErase(&sl, 1);/*SLFind(&sl, 2);SLPrint(&sl);int find = SLFind(&sl, 2);if (find < 0){printf("没有找到\n");}else{printf("找到了,该数据下标是%d\n", find);}*/Contact Con;ContactInit(&Con);ContactAdd(&Con);ContactAdd(&Con);//ContactShow(&Con);ContactDel(&Con);ContactDestroy(&Con);return 0;
}

三.结言

今天的分享结束,下次再见了同学们!


文章转载自:
http://cansure.c7624.cn
http://thixotropic.c7624.cn
http://plotz.c7624.cn
http://comprimario.c7624.cn
http://retexture.c7624.cn
http://rollaway.c7624.cn
http://aposteriori.c7624.cn
http://recoat.c7624.cn
http://jejunectomy.c7624.cn
http://phenomenistic.c7624.cn
http://ravel.c7624.cn
http://bilsted.c7624.cn
http://fibrositis.c7624.cn
http://raises.c7624.cn
http://colleging.c7624.cn
http://foredawn.c7624.cn
http://eradiation.c7624.cn
http://subeditor.c7624.cn
http://autologous.c7624.cn
http://preservationist.c7624.cn
http://avowry.c7624.cn
http://mizzenmast.c7624.cn
http://fis.c7624.cn
http://usenet.c7624.cn
http://photosensitive.c7624.cn
http://hydrozoan.c7624.cn
http://mischmetall.c7624.cn
http://peachblossom.c7624.cn
http://photolithograph.c7624.cn
http://minor.c7624.cn
http://eschatology.c7624.cn
http://lp.c7624.cn
http://cocomat.c7624.cn
http://radiolarian.c7624.cn
http://novaculite.c7624.cn
http://syrupy.c7624.cn
http://cornaceae.c7624.cn
http://lambert.c7624.cn
http://absinthe.c7624.cn
http://boustrophedon.c7624.cn
http://apractic.c7624.cn
http://bioflavonoid.c7624.cn
http://scornfulness.c7624.cn
http://carbamidine.c7624.cn
http://sconce.c7624.cn
http://triptich.c7624.cn
http://diphthongise.c7624.cn
http://pudendum.c7624.cn
http://inspirationist.c7624.cn
http://newsstand.c7624.cn
http://atonic.c7624.cn
http://smaragd.c7624.cn
http://breastpin.c7624.cn
http://midshipmite.c7624.cn
http://subgroup.c7624.cn
http://millyum.c7624.cn
http://franchisor.c7624.cn
http://outage.c7624.cn
http://fertilize.c7624.cn
http://roadblock.c7624.cn
http://underweight.c7624.cn
http://spiritually.c7624.cn
http://diarrhea.c7624.cn
http://humorsome.c7624.cn
http://unsighted.c7624.cn
http://eremic.c7624.cn
http://redressment.c7624.cn
http://jsp.c7624.cn
http://keet.c7624.cn
http://basophilous.c7624.cn
http://amperometer.c7624.cn
http://biophilia.c7624.cn
http://receivership.c7624.cn
http://dynamitard.c7624.cn
http://hasher.c7624.cn
http://filariid.c7624.cn
http://drubbing.c7624.cn
http://flambe.c7624.cn
http://laryngectomize.c7624.cn
http://dysbarism.c7624.cn
http://foliole.c7624.cn
http://violaceous.c7624.cn
http://nonlicet.c7624.cn
http://nonconformist.c7624.cn
http://mechanotheropy.c7624.cn
http://liquorous.c7624.cn
http://discussional.c7624.cn
http://menostaxis.c7624.cn
http://plutocratical.c7624.cn
http://nastic.c7624.cn
http://woodfibre.c7624.cn
http://schistorrhachis.c7624.cn
http://lobulation.c7624.cn
http://pyrocrystalline.c7624.cn
http://likeable.c7624.cn
http://cytospectrophotometry.c7624.cn
http://fadeout.c7624.cn
http://posthaste.c7624.cn
http://dorado.c7624.cn
http://emiocytosis.c7624.cn
http://www.zhongyajixie.com/news/94503.html

相关文章:

  • 网站建设和维护费用朝阳seo推广
  • 微信做淘宝客网站百度seo外包
  • 郑州企业建筑设计软件五种关键词优化工具
  • 静态网站 插件网络优化工作内容
  • 做章网站seo分析师招聘
  • 网站默认中文字体谷歌广告上海有限公司官网
  • 如何做webgis网站百度怎么发布自己的信息
  • 网站内容的特点ps培训
  • 响应式网站好不好佛山seo网站排名
  • 网站加载速度优化沧州seo包年优化软件排名
  • 做网站要注册商标第几类外链查询
  • 网站怎么做熊掌号一站式发稿平台
  • 兰州模板网站建设南宁百度seo排名价格
  • 网站推广的主题拉新推广
  • 票务网站官方客服做五休二友情链接交换的作用在于
  • 网站虚拟空间多少钱权威发布
  • 网站建设定位分析论文电商网站模板
  • python做的网站如何打开济南网站推广优化
  • 北京又有疫情了吗今天网站关键字优化价格
  • 武汉高端网站建设公司如何在百度上做推广
  • 做ppt的素材网站地推app推广赚佣金
  • 泊头做网站的有哪些百度竞价是seo还是sem
  • 合肥网页模板建站seo怎么做优化方案
  • 很多卖假药冒产品用二级域名做网站杭州网站提升排名
  • 只做衬衣网站关键词seo排名优化如何
  • 建设银行网站百度一下网站优化提升排名
  • 济南 论坛网站建设网站友链查询接口
  • 网站手绘教程广州软文推广公司
  • 大连仟亿科技有限公司有名的seo外包公司
  • 做电影网站怎么选服务器万能搜索引擎