文档库 最新最全的文档下载
当前位置:文档库 › 简易通讯录代码

简易通讯录代码

简易通讯录代码
简易通讯录代码

#include

#include //

#include //system()

#include

#include

#include

#include

struct Info

{

char name[18];

char phone[12];

};

typedef struct Info Elemtype; typedef struct Node

{

Elemtype data;

struct Node *next;

}LNode,*record;

record create();

record add_info(LNode *HL);

int del_info(LNode *HL);

int update_info(LNode *HL);

int search_by_name(LNode *HL); int search_by_phone(LNode *HL);

void print_node(LNode *p1); void list_all(LNode *HL);

int save_data();

record load_data();

void release_memery(record HL);

record create()

{

record HL;

HL=NULL;

return HL;

}

record add_info(LNode *HL)

{

record newptr;

newptr=(record)malloc(sizeof(LNode));

if (!newptr)

{

printf("--------------------------------\n");

printf("Application memory space fails!\n please press any key to continue...\n");

getchar();

return 0;

}

printf("please enter name:\n");

gets(newptr->https://www.wendangku.net/doc/9c10813388.html,);

printf("please enter phone:\n");

gets(newptr->data.phone);

newptr->next=HL;

HL=newptr;

printf("--------------------------------\n");

printf("Add a message successfully!\n please press any key to continue...\n");

getchar();

return HL;

}

int getch()

{

int ch;

struct termios old, new;

tcgetattr(STDIN_FILENO, &old);

new = old;

new.c_lflag &= ~(ICANON | ISIG | ECHO);

tcsetattr(STDIN_FILENO, TCSANOW, &new);

ch = getchar();

tcsetattr(STDIN_FILENO, TCSANOW, &old);

return ch;

}

int del_info(LNode *HL)

{

char name[18];

LNode *p,*q;

p=(LNode*)malloc(sizeof(LNode));

q=(LNode*)malloc(sizeof(LNode));

p=HL; q=NULL;

printf("Enter the name you want to del records:\n");

gets(name);

while(p!=NULL)

{

if(strcmp(name,p->https://www.wendangku.net/doc/9c10813388.html,)==0)

break;

else

{

q=p;

p=p->next;

}

}

if(p==NULL)

{

printf("--------------------------------\n");

printf("no such record!\n please press any key to continue...\n");

getch();

return 0;

}

else

{

if(q==NULL)

HL=HL->next;

else

q->next=p->next;

free(p);

printf("--------------------------------\n");

printf("\nnDeleted successfully!\n please press any key to continue...\n");

getch();

return 1;

}

}

int update_info(LNode *HL)

{

char name[18];

LNode *p;

p=(record)malloc(sizeof(LNode));

p=HL;

printf("please enter the name you want to modify records:\n");

gets(name);

while(p!=NULL)

{

if(strcmp(name,p->https://www.wendangku.net/doc/9c10813388.html,)==0)

break;

else

p=p->next;

}

if(p==NULL)

{

printf("\nndelete fails!\n please press any key to continue...\n");

getch();

return 0;

}

printf("please enter new name:");

gets(p->https://www.wendangku.net/doc/9c10813388.html,);

printf("please enter new phone:");

gets(p->data.phone);

printf("--------------------------------\n");

printf("delete successfully !\n please press any key to continue...\n");

getch();

return 1;

}

void print_node(LNode *p1)

{

printf("--------------------------------\n");

printf("name:%s\n",p1->https://www.wendangku.net/doc/9c10813388.html,);

printf("phone:%s\n",p1->data.phone);

printf("--------------------------------\n");

}

void list_all(LNode *HL)

{

system("cls");

printf("Recorded as follows:\n");

while(HL)

{

print_node(HL);

HL=HL->next;

}

getch();

}

int search_by_name(LNode *HL)

{

char name[18];

LNode *p=HL;

printf("please enter name:");

gets(name);

while(p!=NULL)

if(strcmp(name,p->https://www.wendangku.net/doc/9c10813388.html,)==0)

{

printf("The search results are as follows:\n");

print_node(p);

printf("please press any key to continue...");

getch();

return 1;

}

else

p=p->next;

printf("--------------------------------\n");

printf("Sorry!no information !\n please press any key to continue...\n");

getch();

return 0;

}

int search_by_phone(LNode *HL)

{

char phone[12];

LNode* p=HL;

printf("please enter phone:");

gets(phone);

while(p!=NULL)

if(!strcmp(phone,p->data.phone))

{

printf("The search results are as follows:\n");

print_node(p);

printf("please press any key to continue....");

getch();

return 1;

}

else

p=p->next;

printf("--------------------------------\n");

printf("Sorry!no information!\n please press any key to continue...\n");

getch();

return 0;

}

void SortName(record HL)

{ record p,q,s;

q=HL;

p=q->next->next;

q->next->next=NULL;

while(p)

{

while(q->next &&(strcmp(p->https://www.wendangku.net/doc/9c10813388.html,,q->next->https://www.wendangku.net/doc/9c10813388.html,)>0)) q=q->next;

s=p->next;

p->next=q->next;

q->next=p;

p=s;

q=HL;

}

printf("Sort by name:\n");

list_all(HL);

}

void Sort(record HL)

{ record p;

p=HL;

printf("1:Sort by name\n");

SortName(p);

}

int save_data(LNode *HL)

{

FILE *fp;

record p=HL; //

if((fp=fopen("data.txt","wb"))==NULL)

{

printf("Can not open file!\n");

return 0;

}

while(p!=NULL)

{

fprintf(fp,"%c\n",'*');

fprintf(fp,"%s\n ",p->https://www.wendangku.net/doc/9c10813388.html,);

fprintf(fp,"%s\n ",p->data.phone);

p=p->next;

}

fclose(fp);

return 1;

}

record load_data()

{

FILE *fp1;

record p;

record HL=NULL;

fp1=fopen("data.txt","ab+");

if(!fp1)

{

printf("Failed to load data!");

getch();

return NULL;

}

while(!feof(fp1))

{

p=(record)malloc(sizeof(LNode));

if(fread(p,sizeof(LNode),1,fp1)==1)

{

p->next=HL;

HL=p;

}

}

fclose(fp1);

return HL;

}

void release_memery(record HL)

{

record p=HL;

record tmp=NULL;

tmp=(record)malloc(sizeof(LNode));

while(p)

{

tmp=p->next;

free(p);

p=tmp;

}

}

void print_graph()

{

printf("\t\t\t------------------------\n");

}

int mima()

{

char username[15],password[15];

char *p1,*p2;

int i=1;

int j=0,ch=0;

//p1=username;

p2=password;

do

{

system("clear");

printf("\tpassword\t\n");

printf("--------------------\n");

for(i;i<4;i++)

{

//printf("username:");

//scanf("%s",p1);

//getchar();

printf("password:");

for(j=0;j<5;j++)

{

ch=getch();

if(ch=='\n')

break;

password[j]=(char)ch;

putchar(42);

}

password[j-0]=0;

// scanf("%s",p2);

getchar();

if((strncmp(p2,"phone",15)==0))

{

printf("Right\n");

return;

}

else

printf("you have %d times enter ringht letters\n",3-i);

}

}while(i!=4);

exit(0);

return 0;

}

void disp_main_menu()

{

system("cls");

printf("\n\n");

print_graph();

printf("\t\t\t\tPhonebook\n");

print_graph();

printf("\n\t\t\t 1. Query information\n\n");

printf("\t\t\t 2. Edit information\n\n");

printf("\t\t\t 3. Display information\n\n");

printf("\t\t\t 4. Exit\n");

}

void disp_search_menu()

{

system("cls");

printf("\n\n");

print_graph();

printf("\t\t\t\tQuery Menu\n");

print_graph();

printf("\n\t\t\t 1. Inquiry by name\n\n");

printf("\t\t\t 2. Inquiries by phone number\n\n");

printf("\t\t\t 3. Return to the menu\n");

}

void disp_edit_menu()

{

system("cls");

printf("\n\n");

print_graph();

printf("\t\t\t\t Edit Menu\n");

print_graph();

printf("\n\t\t\t 1. Add information\n\n");

printf("\t\t\t 2. Delete information\n\n");

printf("\t\t\t 3. Modify information\n\n");

printf("\t\t\t 4. Return to the menu\n");

}

main()

{

char ch;

LNode *list;

int quit=0;

mima();

list=create();

list=load_data();

do

{

disp_main_menu();

ch=getch();

switch(ch)

{

case '1':

{

int sub1_run=1;

while(sub1_run)

{

disp_search_menu();

ch=getch();

switch(ch)

{

case '1':

search_by_name(list);

break;

case '2':

search_by_phone(list);

break;

case '3':

sub1_run=0;

break;

} //switch

}//while case 1

} //case 1

break;

case '2':

{

int sub2_run=1;

while(sub2_run)

{

disp_edit_menu();

ch=getch();

switch(ch)

{

case '1':

list=add_info(list);

break;

case '2':

del_info(list);

break;

case '3':

update_info(list);

break;

case '4':

sub2_run=0;

break;

}

}

}

printf("Whether to save your changes(y/n)?\n");

if((getchar()=='Y')||(getchar()=='y')){

save_data(list);}

else

break;

break;

case '3':

Sort(list);

break;

case '4':

save_data(list);

quit=1;

break;

default:

printf("please enter1~3!");

getch();

break;

}

system("cls");

} while(!quit);

release_memery(list);

C程序代码大全

//根据半径计算圆的周长和面积#include const float PI=3.1416; //声明常量(只读变量)PI为3.1416 float fCir_L(float); //声明自定义函数fCir_L()的原型 float fCir_S(float); //声明自定义函数fCir_S()的原型 //以下是main()函数 main() { float r,l,s; //声明3个变量 cout<<"r="; //显示字符串 cin>>r; //键盘输入 l=fCir_L(r); //计算圆的周长,赋值给变量l s=fCir_S(r); //计算圆的面积,赋值给变量s cout<<"l="<=70) cout<<"Your grade is a C."<=60) cout<<"Your grade is a D."< main() { int n; cout<<"n="; cin>>n; if (n>=0 && n<=100 &&n%2==0) cout<<"n="< main() { int a,b,Max; .10 for(int i=1;i<=10;i++) cout<=1;j--) cout<

手机通讯录源代码

#include #include #include #include #define N 15 //最大容量为15 typedef struct //定义一个结构 { char name[10]; char haoma[15]; char leibie[10]; char dizhi[20]; }ren; //菜单 void menu() //目录 { system("cls"); //清屏 printf(" ######### 欢迎使用手机通讯录#########\n"); printf("\n"); printf("======================================================================= =======\n"); printf(" 1.~~查询~~ \n"); printf(" 2.~~添加~~ \n"); printf(" 3.~~拨号~~ \n"); printf(" 4.~~修改~~ \n"); printf(" 5.~~删除~~ \n"); printf(" 0. ~~退出~~ \n"); printf("======================================================================= =======\n"); printf("\n"); printf(" 个人通讯录\n"); printf("\n"); printf(" ~~请选择相应的功能~~:"); } void input() //查询 { int help=0; //帮助指令,如果查找所找的类别中没有数据,显示 ren ry; FILE *fp; char leibie[10]; system("cls");

数控编程G、M、T、S代码大全(精选.)

数控机床标准G、M代码 一.准备功能字G 准备功能字是使数控机床建立起某种加工方式的指令,如插补、刀具补偿、固定循环等。G功能字由地址符G和其后的两位数字组成,从G00—G99共100种功能。JB3208-83标准中规定如下表: 代码功能 作用范 围 功能 代码 功能作用范围功能 G00 点定位 G50 * 刀具偏置0/- G01 直线插补 G51 * 刀具偏置+/0 G02 顺时针圆弧插补 G52 * 刀具偏置-/0 G03 逆时针圆弧插补 G53 直线偏移注销 G04 * 暂停 G54 直线偏移 X G05 * 不指定 G55 直线偏移Y G06 抛物线插补 G56 直线偏移Z G07 * 不指 定 G57 直线偏移XY G08 * 加速 G58 直线偏移XZ G09 * 减速 G59 直线偏移YZ G10-G16 * 不指定 G60 准确定位(精) G17 XY平面选 择 G61 准确定位(中) G18 ZX平面选择 G62 准确定位(粗) G19 YZ平面选择 G63 * 该丝 G20-G32 * 不指定 G64-G67 * 不指定 G33 螺纹切削,等螺距 G68 * 刀具偏置,内角 G34 螺纹切削,增螺距 G69 * 刀具偏置,外角 G35 螺纹切削,减螺距 G70-G79 * 不指定 G36-G39 * 不指定 G80 固定循环注销 G40 刀具补偿/刀具偏置 注销 G81-G89 固定循环 G41 刀具补偿--左 G90 绝对尺寸 G42 刀具补偿-- 右 G91 增量尺寸 G43 * 刀具偏置--正 G92 * 预置寄存 G44 * 刀具偏置--右 G93 进给率,时间倒数 G45 * 刀具偏置+/+ G94 每分钟进给 G46 * 刀具偏置+/- G95 主轴每转进给 G47 * 刀具偏置-/- G96 恒线速 度 G48 * 刀具偏置-/+ G97 每分钟转数(主轴) G49 * 刀具偏置0/+ G98-G99 * 不指定 注:*表示如作特殊用途,必须在程序格式中说明二.辅助功能字M

安卓手机拨号键盘隐藏工程代码大全

安卓手机拨号键盘隐藏工程代码大全 安卓手机拨号键盘隐藏工程代码大全 ? 在拨号面板中输入就可执行,但不保证所有代码在你的手机上都可执行。 ?*#*#4636#*#* 显示手机信息、电池信息、电池记录、使用统计数据、WiFi 信息 *#*#7780#*#* 或 *#7780# 重设为原厂设定,不会删除预设程序,及SD 卡档案。 *2767*3855# 重设为原厂设定,会删除SD 卡所有档案。*#*#34971539#*#* 显示相机相机韧体版本,或更新相机韧体 *#*#7594#*#* 当长按关机按钮时,会出现一个切换手机模式的窗口,包括: 静音模式、飞航模式及关机,你可以用以上代码,直接变成关机按钮。 *#*#273283*255*663282*#*#* 开启一个能让你备份媒体文件的地方,例如相片、声音及影片等 *#*#197328640#*#* 启动服务模式,可以测试手机部分设置及更改设定 WLAN、GPS 及蓝牙

*#*#232339#*#* 或 *#*#526#*#* 或 *#*#528#*#* WLAN 测试 *#*#232338#*#* 显示WiFi MAC 地址 *#3214789650# 进入GPS工程模式 *#*#1472365#*#* GPS 测试 *#*#1575#*#* 其它GPS 测试 *#*#232331#*#* 蓝牙测试 *#232337# 或 *#*#232337#*#* 显示蓝牙装置地址 *#*#8255#*#* 启动GTalk 服务监视器 显示手机软件版本的代码 *2767*4387264636# 显示产品代码,这个不知能不能更改,如果不可以的话,在这可以看自己手机的版本. *#12580*369# 显示PDA,Phone,H/W,第一次打电话,内存,CSC信息. *#*#4986*2650468#*#* PDA、Phone、H/W、RFCallDate *#*#1234#*#* 显示PDA 及Phone等固件信息 *#*#1111#*#* FTA SW 版本 *#*#2222#*#* FTA HW 版本 *#*#44336#*#* PDA 、Phone、CSC、Build Time、

C语言代码大全

------------------------------------------------------------------------摘自宋鲁生程序设计大赛 乘法口诀表 #include #include void main(void) { int i,j,x,y; clrscr(); printf("\n\n * * * 乘法口诀表* * * \n\n"); x=9; y=5; for(i=1;i<=9;i++) { gotoxy(x,y); printf("%2d ",i); x+=3; } x=7; y=6; for(i=1;i<=9;i++) { gotoxy(x,y); printf("%2d ",i); y++; } x=9; y= 6; for(i=1;i<=9;i++) { for(j=1;j<=9;j++) { gotoxy(x,y); printf("%2d ",i*j); y++; } y-=9; x+=3; } printf("\n\n"); }

用一维数组统计学生成绩 #include void main() { char SelectKey,CreditMoney,DebitMoney; while(1) { do{ clrscr(); puts("========================="); puts("| Please select key: |"); puts("| 1. Quary |"); puts("| 2. Credit |"); puts("| 3. Debit |"); puts("| 4. Return |"); puts("========================="); SelectKey = getch(); }while( SelectKey!='1' && SelectKey!='2' && SelectKey!='3' && SelectKey!='4' ); switch(SelectKey) { case '1': clrscr(); puts("================================"); puts("| Your balance is $1000. |"); puts("| Press any key to return... |"); puts("================================"); getch(); break; case '2': do{ clrscr(); puts("=================================="); puts("| Please select Credit money: |"); puts("| 1. $50 |"); puts("| 2. $100 |"); puts("| 3. Return |"); puts("=================================="); CreditMoney = getch(); }while( CreditMoney!='1' && CreditMoney!='2' && CreditMoney!='3' ); switch(CreditMoney)

个人通讯录管理系统c语言源程序优秀版)

#include /*头文件*/ #include //包含最常用的系统函数 #include //关于字符数组的函数定义的头文件#include //控制台输入输出 //定义结构体 struct tongxunlu /*定义通讯录结构体变量*/ { char xingming[20]; /*定义输入名字的数组*/ char dianhua[20]; /*定义输入电话号码的数组*/ char dizhi[40]; /*定义输入地址的数组*/ } txl[100]; //默认100个数据 int n=0;//记录数据联系人数量 FILE *fp; /*定义文件*/ //程序用到的所有函数 void zhucaidan(); /*主菜单函数*/ void zengjia(); /*增加联系人函数*/ void readfile(); /*文件中读入函数*/ void writefile(); /*文件中写入函数*/ void xiugai(); /*修改联系人函数*/ void xiugai_xingming(); /*姓名修改*/ void xiugai_dianhua(); /*电话号码修改*/ void chazhao(); /*查找联系人函数*/

void chazhao_xingming(); /*按姓名查找*/ void chazhao_dianhua(); /*按号码查找*/ void shanchu(); /*删除联系人函数*/ void shanchu_quanbu(); /*全部删除*/ void shanchu_dange(); /*单个删除*/ void xianshi(); /*号码显示*/ //程序主函数模块六 void main() /*主函数main*/ { readfile(); /*读入文件*/ while(1) /* 循环(永远进行)*/ { zhucaidan(); /*调用主菜单函数*/ } } //读取文件函数部分开始模块七 void readfile() { if((fp=fopen("c:\\通讯录.txt","r"))==NULL) /*以只读方式打开判定文件是否为空*/ { printf("\n\t\t\t 通讯录文件不存在"); /*判断结论*/ if ((fp=fopen("同通讯录.txt","w"))==NULL) /*只写方式判断*/

简单通讯录C++实现

简单通信录的C++实现 这是一个简单的通讯录系统,数据结构内包括学号,姓名,手机号,具备增加、删除、修改、查询的功能。 //2015/3/12 by LDSD #include #include using namespace std; struct node { char num[15]; char name[7]; char phone[12]; node *next; }; void serch(node *head) { head=head->next; char con; char data[15]; while(1) { cout<<"1:按学号查询 2:按姓名查询,请选择指令执行操作。\n"; cin>>con; if(con=='1') { cout<<"请输入学号。"<>data; while(head!=NULL) { if(strcmp(head->num,data)==0) { cout<num<<'\t'<name<<'\t'<phone<<'\n';break; } else head=head->next; } if(head==NULL)

cout<<"未查询到匹配的记录!"<>data; while(head!=NULL) { if(strcmp(head->name,data)==0) { cout<num<<'\t'<name<<'\t'<phone<<'\n';break; } else head=head->next; } if(head==NULL) cout<<"未查询到匹配的记录!"<>new_stu->num>>new_stu->name>>new_stu->phone; new_stu->next=head->next; head->next=new_stu; } void modify(node *head) { char num[15]; char name[7]; char phone[12]; node *head1=head->next; int i=1; node *new_stu=new node; cout<<"通讯录内容如下,请依次输入编号,学号,姓名,电话号码,以便对信息更新。\n"; while(head1!=NULL) { cout<num<<'\t'<name<<'\t'<phone<<'\n'; head1=head1->next;

C 经典程序代码大全

C 经典程序代码大全 #include const float PI= 3.1416; //声明常量(只读变量)PI为 3.1416 float fCir_L(float); //声明自定义函数fCir_L()的原型 float fCir_S(float); //声明自定义函数fCir_S()的原型 //以下是main()函数 main() { float r,l,s; //声明3个变量 cout>r; //键盘输入 l=fCir_L(r); //计算圆的周长,赋值给变量l s=fCir_S(r); //计算圆的面积,赋值给变量s cout=0.0) //如果参数大于0,则计算圆的周长 z=2*PI*x; return(z); //返回函数值 } //定义计算圆的面积的函数fCir_S() float fCir_S(float x) { float z=- 1.0; //声明局部变量 if (x>=0.0) //如果参数大于0,则计算圆的面积 z=PI*x*x; return(z); //返回函数值 } /* Program: P1- 2.CPP Written by: Hap Date written: 02:11:10 */ #include void main(void) { double s1,s2,s3; s1= 1.5; /* 对变量s1赋值*/ cout main() { double r=

1.0; cout>r; //键盘输入 l=2* 3.1416*r; //计算圆的周长,赋值给变量l cout //包含iostream.h头文件 void main() { //输出字符常量.变量和字符串 char c1= A ; cout //包含iostream.h头文件 main() { //输入输出字符 char c; cin>>c; cout>n; cout>x; cout>n; cout>c>>n>>x; cout //包含iostream.h头文件 main() { //声明整型变量 int a,b; //从键盘上为整型变量赋值cout>a; cout>b; //整型数的算术运算 cout //包含iostream.h 头文件 main() { //声明变量,并初始化 int a=010,b=10,c=0X10; //以进制形式显示数据 cout>a; cout>b; cout>c; cout //包含iostream.h头文件 #include // iomanip.h头文件包含setprecision()的定义 main() { //float型变量的声明.输入.计算和输出 float fx,fy; cout>fx; cout>fy; cout>dx; cout>dy; cout //包含iostream.h 头文件 main() { //字符类型变量的声明 char c1= A ; char c2; //字符数据的运算及输出 c2=c1+32; cout>c1>>c2; cout //包含iostream.h头文件 main() { char c1= \a ,TAB= \t ; //阵铃一声 cout //包含iostream.h头文件 main()

手机工程模式大全

三星手机:解话机锁:*2767*2878#/*2767*7377# 三星码片复位:*2767*3855# 也可用于解机锁或卡锁 三星显温度、电池容量:*#0228# 三星调显示屏对比度:*#0523# 三星软件版本:*#9999# 三星A100-A188看版本:*#0837# 摩托罗拉T2688解所有锁:19980722 T2688/2988/988d没有中文:*#0000# OK(插卡) 摩托罗拉所有机锁:按MENU+5+1/2 西门子恢复出厂设置:*#9999# 西门子乱文回中文:*#0000#/*#0086# 西门子软件版本:*#06# 左键 爱立信老机回英语:*#0000# 爱立信新机回英语:按CLR-左键-0000-右键 爱立信显出厂日期:右、*、左、左、*、左、*键 诺基亚显出厂日期:*#0000#(插卡) 诺基亚省30%电:*#746025625# 飞利浦强迫重连网:*#2562*# 博世(BOSCH)909S回中文:*#0852# 博世(BOSCH)909s回英文:*#0851# NEC显软件版本:*#2820# NEC恢复原厂设置:*#73738# 波导s1000隐藏功能:*#*#1705# 波导s1000解锁:*#*#1705#46(也用于999D,720) 如死机再用---24681357(或直接就用它解) 波导8xx/9xx系列:*#+串号7-14位# SIM卡波导串号最后9位去掉最后一位 阿尔卡特OT221/220解锁:25228352/ALCATEL+D 阿尔卡特OT301/302解锁:83227423 阿尔卡特OT500/700解锁:25228352 康佳:*#0001# *#1001# ##1001# 康佳小雪5219:#8879576# 原始:1234 GVC:*#1001* (海尔) 南方高科320开机键入##1001#,然后装上卡输入0000 OK 三菱NET LOCK:*787090或*787292 三菱IMSI LOCK:*362628或*360608 三菱NETSUB LOCK:*476989 三菱CP LOCK:*482896或*480896 三菱SP LOCK:*967678 三菱EXT LOCK:*574243 飞利浦手机通用秘技 手机在待机状态下时,请输入以下按键组合: *#06# 查看IME串码 *#2254*#显示状况行

CNC加工中心程序代码大全

1. 数控程序中字母的含义 O:程序号,设定程序号 N:程序段号,设定程序顺序号 G:准备功能 X/Y/Z :尺寸字符,轴移动指令 A/B/C/U/V/W:附加轴移动指令 R:圆弧半径 I/J/K:圆弧中心坐标(矢量) F:进给,设定进给量 S:主轴转速,设定主轴转速 T:刀具功能,设定刀具号 M:辅助功能,开/关控制功能 H/D:刀具偏置号,设定刀具偏置号 P/X:延时,设定延时时间 P:程序号指令,设定子程序号(如子程序调用:M98P1000) L:重复,设定子程序或固定循环重复次数(如:M98 P1000 L2,省略L代表L1)P/W/R/Q:参数,固定循环使用的参数(如:攻牙G98/(G99)G84 X_ Y_ R_ Z_ P_ F_) 2. 常用G代码解释 G00:定位或快速移动 G01:直线插补 G02:圆弧插补/螺旋线插补CW G03:圆弧插补/螺旋线插补CCW G04:停留时间或延时时间 如:G04 X1000(或G04 X1.0) G04 P1000表示停留1秒钟 G09:准确停止或精确停止检查(检查是否在目标范围内) G10:可编程数据输入 G17:选择XPYP 平面 XP:X 轴或其平行轴 G18:选择ZPXP 平面 YP:Y 轴或其平行轴 G19:选择YPZP 平面 ZP:Z 轴或其平行轴 G20:英寸输入 G21:毫米输入 G28:返回参考点检测 格式:G91/(G90) G28 X__ Y__ Z__ 经过中间点X__ Y__ Z__返回参考点(绝对值/增量值指令) G29:从参考点返回 G91/(G90) G29 X__ Y__ Z__ 从起始点经过参考点返回到目标点X__ Y__ Z__的指令(绝对值/增量值指令) G30 返回第2,3,4 参考点 G91/(G90) G30 P2 X__ Y__ Z__;返回第2 参考点(P2 可以省略。) G91/(G90) G30 P3 X__ Y__ Z__;返回第3 参考点

个人通讯录管理系统,java源代码

/** * 业务类 */ public class PABmanager { /** * 系统启动 */ public static void main(String[] args) { Scanner input = new Scanner(System.in); String num = input.next(); if ("1".equals(num)) { String lbmc = input.next(); String lbsm = input.next(); String lbbz = input.next(); Type type = new Type(lbmc,lbsm,lbbz); typeDao.createType(type); }else if ("2".equals(num)) { List types = typeDao.queryType(); for (int i = 0; i < types.size(); i++) { Type type =types.get(i);

} }else if ("3".equals(num)) { String lbmc = input.next(); Type type = new Type(lbmc,null,null); typeDao.deleteType(type); }else if ("4".equals(num)) { break; }else{ } } }else if ("2".equals(in2)) { break; }else{ } } }else if ("3".equals(in2)) { System.exit(-1); }else{ } } } }

(简易手机通讯录管理系统)

一、课题名称 简易手机通讯录管理系统(线性表、查找、排序) 二、主要内容 简易手机通讯录管理系统的设计主要是实现对手机通讯录的管理和相关操作。基本功能如下: (1)联系人信息录入、添加功能:包括手机号(此处用短号,5位,不能重复)、姓名、家庭住址的录入和添加。 (2)联系人信息查询功能:能①按手机号进行查询。②按联系人姓名进行查询。 (3)排序:①能按手机号升序进行排序;②能按姓名进行升序排序,姓名相同时按手机号从小到大进行排序 (4)联系人信息的修改、删除功能:①按手机号进行联系人信息的修改和删除。 ②按姓名进行联系人信息的修改和删除,多个姓名时,再指定具体的号码。 (5)统计功能:统计自己的联系人有多少个。 三、课题设计的基本思想,原理和算法描述 (1)本次课程设计题目为简易手机通讯录管理系统,主要运用到线性表中顺序表的相关知识,以及顺序查找的思想和冒泡排序算法。 (2)界面设计 //菜单函数 int menu() { int c; printf("\n\n\t☆☆☆☆☆☆☆手机通讯录信息管理系统☆☆☆☆☆☆☆☆\n\n"); printf("******************************************************************* ***\n"); printf(" 1.添加联系人信息\n"); printf(" 2.查询联系人信息\n"); printf(" 3.对联系人信息进行排序\n"); printf(" 4.修改联系人信息\n"); printf(" 5.删除联系人信息\n"); printf(" 6.统计联系人个数\n"); printf(" 0.退出信息管理系统\n"); printf("******************************************************************* ***\n\n");

手机通讯录开发源代码

设计开发源代码 1.AddContactsActivity类 package .demo.pr3; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.EditText; import android.widget.Toast; import .demo.pr3.datax.ContactsTable; import https://www.wendangku.net/doc/9c10813388.html,er; /*增加记录操作界面*/ public class AddContactsActivity extends Activity { private EditText nameEditText; //输入框 private EditText mobileEditText; //手机输入框 private EditText qqEditText; //qq private EditText danweiEditText; //单位 private EditText addressEditText; //地址 Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(https://www.wendangku.net/doc/9c10813388.html,yout.edit); setTitle("添加联系人"); //从已设置的页面布局查找对应的控件 nameEditText=(EditText)findViewById(https://www.wendangku.net/doc/9c10813388.html,); mobileEditText=(EditText)findViewById(R.id.mobile); danweiEditText=(EditText)findViewById(R.id.danwei); qqEditText=(EditText)findViewById(R.id.qq); addressEditText=(EditText)findViewById(R.id.address); } /*创建菜单 */ public boolean onCreateOptionsMenu(Menu menu) { menu.add(Menu.NONE,1, Menu.NONE, "保存"); menu.add(Menu.NONE,2, Menu.NONE, "返回"); return super.onCreateOptionsMenu(menu); } /* 菜单事件*/ public boolean onOptionsItemSelected(MenuItem item){ // TODO Auto-generated method stub

相关文档
相关文档 最新文档