-
抽獎程序,可隨即抽取n等獎n個(gè)
抽獎程序,可隨即抽取n等獎n個(gè)
標(biāo)簽:
程序
上傳時(shí)間:
2014-01-24
上傳用戶:jyycc
-
簡單命令使用grep等的使用
[zorro@isch ~]$ history
1 ifconfig
2 su
3 exit
4 ls
5 cd Desktop/
6 ls
7 tar zxcf VMwareTools-8.4.5-324285.tar.gz
8 tar zxvf VMwareTools-8.4.5-324285.tar.gz
9 cd vmware-tools-distrib/
10 ls
11 ./vmware-install.pl
12 su
13 ls
14 cd ..
15 ls
16 rm VMwareTools-8.4.5-324285.tar.gz
17 rm -r vmware-tools-distrib
18 ls
19 make
20 ls
21 cd redis/
22 quit
23 ls
24 ca redis/
25 cd redis/
26 cd redis-2.8.17
27 make
28 cd redis-2.8.17
29 ls
30 cd redis-2.8.17
31 cd str
32 cd src
33 ls
34 ./redis-cli
35 ls
36 cd redis-2.8.17 tar.gz
37 make
38 cd src
39 ./redis-server .. /redis.conf
40 ./redis-cli
41 ./redis-server ../redis.conf
42 vi test1.sh
43 ./test1.sh
44 vi test.sh
45 ./test.sh
46 ls
47 chmod 777 test.sh
48 ./test.sh
49 vi express
50 $ grep –n ‘the’ express
51 clear
52 grep -n 'the' express
53 vi express
54 grep -n 'the' express
55 grep -vn 'the'express
56 grep -vn 'the' express
57 grep -in 'the' express
58 vi test2.c
59 grep -l 'the' *.c
60 grep -n 't[ae]st' express
61 grep -n 'oo' express
62 grep -n '[^g]oo' express
63 grep -n '[a^z]oo' express
64 grep -n '[0^9]' express
65 grep -n '^the' express
66 vi express
67 sed -e 'd' express
68 sed -e '1d' express
69 sed -e '1~7d' express
70 sed -e '$d' express
71 sed -e '1,/^$/d' express
72 ls
73 cd
74 pwd
75 history
[zorro@isch ~]$
標(biāo)簽:
簡單命令使用
上傳時(shí)間:
2016-05-24
上傳用戶:12345678gan
-
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NULL 0
#define MaxSize 30
typedef struct athletestruct /*運(yùn)動員*/
{
char name[20];
int score; /*分?jǐn)?shù)*/
int range; /**/
int item; /*項(xiàng)目*/
}ATH;
typedef struct schoolstruct /*學(xué)校*/
{
int count; /*編號*/
int serial; /**/
int menscore; /*男選手分?jǐn)?shù)*/
int womenscore; /*女選手分?jǐn)?shù)*/
int totalscore; /*總分*/
ATH athlete[MaxSize]; /**/
struct schoolstruct *next;
}SCH;
int nsc,msp,wsp;
int ntsp;
int i,j;
int overgame;
int serial,range;
int n;
SCH *head,*pfirst,*psecond;
int *phead=NULL,*pafirst=NULL,*pasecond=NULL;
void create();
void input ()
{
char answer;
head = (SCH *)malloc(sizeof(SCH)); /**/
head->next = NULL;
pfirst = head;
answer = 'y';
while ( answer == 'y' )
{
Is_Game_DoMain:
printf("\nGET Top 5 when odd\nGET Top 3 when even");
printf("\n輸入運(yùn)動項(xiàng)目序號 (x<=%d):",ntsp);
scanf("%d",pafirst);
overgame = *pafirst;
if ( pafirst != phead )
{
for ( pasecond = phead ; pasecond < pafirst ; pasecond ++ )
{
if ( overgame == *pasecond )
{
printf("\n這個(gè)項(xiàng)目已經(jīng)存在請選擇其他的數(shù)字\n");
goto Is_Game_DoMain;
}
}
}
pafirst = pafirst + 1;
if ( overgame > ntsp )
{
printf("\n項(xiàng)目不存在");
printf("\n請重新輸入");
goto Is_Game_DoMain;
}
switch ( overgame%2 )
{
case 0: n = 3;break;
case 1: n = 5;break;
}
for ( i = 1 ; i <= n ; i++ )
{
Is_Serial_DoMain:
printf("\n輸入序號 of the NO.%d (0<x<=%d): ",i,nsc);
scanf("%d",&serial);
if ( serial > nsc )
{
printf("\n超過學(xué)校數(shù)目,請重新輸入");
goto Is_Serial_DoMain;
}
if ( head->next == NULL )
{
create();
}
psecond = head->next ;
while ( psecond != NULL )
{
if ( psecond->serial == serial )
{
pfirst = psecond;
pfirst->count = pfirst->count + 1;
goto Store_Data;
}
else
{
psecond = psecond->next;
}
}
create();
Store_Data:
pfirst->athlete[pfirst->count].item = overgame;
pfirst->athlete[pfirst->count].range = i;
pfirst->serial = serial;
printf("Input name:) : ");
scanf("%s",pfirst->athlete[pfirst->count].name);
}
printf("\n繼續(xù)輸入運(yùn)動項(xiàng)目(y&n)?");
answer = getchar();
printf("\n");
}
}
void calculate() /**/
{
pfirst = head->next;
while ( pfirst->next != NULL )
{
for (i=1;i<=pfirst->count;i++)
{
if ( pfirst->athlete[i].item % 2 == 0 )
{
switch (pfirst->athlete[i].range)
{
case 1:pfirst->athlete[i].score = 5;break;
case 2:pfirst->athlete[i].score = 3;break;
case 3:pfirst->athlete[i].score = 2;break;
}
}
else
{
switch (pfirst->athlete[i].range)
{
case 1:pfirst->athlete[i].score = 7;break;
case 2:pfirst->athlete[i].score = 5;break;
case 3:pfirst->athlete[i].score = 3;break;
case 4:pfirst->athlete[i].score = 2;break;
case 5:pfirst->athlete[i].score = 1;break;
}
}
if ( pfirst->athlete[i].item <=msp )
{
pfirst->menscore = pfirst->menscore + pfirst->athlete[i].score;
}
else
{
pfirst->womenscore = pfirst->womenscore + pfirst->athlete[i].score;
}
}
pfirst->totalscore = pfirst->menscore + pfirst->womenscore;
pfirst = pfirst->next;
}
}
void output()
{
pfirst = head->next;
psecond = head->next;
while ( pfirst->next != NULL )
{
// clrscr();
printf("\n第%d號學(xué)校的結(jié)果成績:",pfirst->serial);
printf("\n\n項(xiàng)目的數(shù)目\t學(xué)校的名字\t分?jǐn)?shù)");
for (i=1;i<=ntsp;i++)
{
for (j=1;j<=pfirst->count;j++)
{
if ( pfirst->athlete[j].item == i )
{
printf("\n %d\t\t\t\t\t\t%s\n %d",i,pfirst->athlete[j].name,pfirst->athlete[j].score);break;
}
}
}
printf("\n\n\n\t\t\t\t\t\t按任意建 進(jìn)入下一頁");
getchar();
pfirst = pfirst->next;
}
// clrscr();
printf("\n運(yùn)動會結(jié)果:\n\n學(xué)校編號\t男運(yùn)動員成績\t女運(yùn)動員成績\t總分");
pfirst = head->next;
while ( pfirst->next != NULL )
{
printf("\n %d\t\t %d\t\t %d\t\t %d",pfirst->serial,pfirst->menscore,pfirst->womenscore,pfirst->totalscore);
pfirst = pfirst->next;
}
printf("\n\n\n\t\t\t\t\t\t\t按任意建結(jié)束");
getchar();
}
void create()
{
pfirst = (struct schoolstruct *)malloc(sizeof(struct schoolstruct));
pfirst->next = head->next ;
head->next = pfirst ;
pfirst->count = 1;
pfirst->menscore = 0;
pfirst->womenscore = 0;
pfirst->totalscore = 0;
}
void Save()
{FILE *fp;
if((fp = fopen("school.dat","wb"))==NULL)
{printf("can't open school.dat\n");
fclose(fp);
return;
}
fwrite(pfirst,sizeof(SCH),10,fp);
fclose(fp);
printf("文件已經(jīng)成功保存\n");
}
void main()
{
system("cls");
printf("\n\t\t\t 運(yùn)動會分?jǐn)?shù)統(tǒng)計(jì)\n");
printf("輸入學(xué)校數(shù)目 (x>= 5):");
scanf("%d",&nsc);
printf("輸入男選手的項(xiàng)目(x<=20):");
scanf("%d",&msp);
printf("輸入女選手項(xiàng)目(<=20):");
scanf("%d",&wsp);
ntsp = msp + wsp;
phead = (int *)calloc(ntsp,sizeof(int));
pafirst = phead;
pasecond = phead;
input();
calculate();
output();
Save();
}
標(biāo)簽:
源代碼
上傳時(shí)間:
2016-12-28
上傳用戶:150501
-
取各障礙物頂點(diǎn)連線的中點(diǎn)為路徑點(diǎn),相互連接各路徑點(diǎn),將機(jī)器人移動的起點(diǎn)和終點(diǎn)限制在各路徑點(diǎn)上,利用最短路徑算法來求網(wǎng)絡(luò)圖的最短路徑,找到從起點(diǎn)P1到終點(diǎn)Pn的最短路徑。上述算法使用了連接線中點(diǎn)的條件,因此不是整個(gè)規(guī)劃空間的最優(yōu)路徑,然后利用遺傳算法對找到的最短路徑各個(gè)路徑點(diǎn)Pi (i=1,2,…n)調(diào)整,讓各路徑點(diǎn)在相應(yīng)障礙物端點(diǎn)連線上滑動,利用Pi= Pi1+ti×(Pi2-Pi1)(ti∈[0,1] i=1,2,…n)即可確定相應(yīng)的Pi,即為新的路徑點(diǎn),連接此路徑點(diǎn)為最優(yōu)路徑。
標(biāo)簽:
遺傳算法
路徑規(guī)劃
matlab
上傳時(shí)間:
2017-05-05
上傳用戶:tttt123
-
鏈表習(xí)題
1. 編程實(shí)現(xiàn)鏈表的基本操作函數(shù)。
(1). void CreatList(LinkList &La,int m)
//依次輸入m個(gè)數(shù)據(jù),并依次建立各個(gè)元素結(jié)點(diǎn),逐個(gè)插入到鏈表尾;建立帶表頭結(jié)點(diǎn)的單鏈表La;
(2). void ListPrint(LinkList La)
//將單鏈表La的數(shù)據(jù)元素從表頭到表尾依次顯示。
(3).void ListInsert (LinkList &L,int i,ElemType e){
//在帶頭結(jié)點(diǎn)的單鏈表L中第i個(gè)數(shù)據(jù)元素之前插入數(shù)據(jù)元素e
(4). void ListDelete(LinkList &La, int n, ElemType &e)
//刪除鏈表的第n個(gè)元素,并用e返回其值。
(5). int Search(LinkList L, ElemType x)
//在表中查找是否存在某個(gè)元素x,如存在則返回x在表中的位置,否則返回0。
(6). int ListLength(LinkList L) //求鏈表L的表長
(7). void GetElem(LinkList L, int i, ElemType &e)
//用e返回L中第i個(gè)元素的值
鏈表的結(jié)點(diǎn)類型定義及指向結(jié)點(diǎn)的指針類型定義可以參照下列代碼:
typedef struct Node{
ElemType data; // 數(shù)據(jù)域
struct Node *next; // 指針域
}LNode, *LinkList;
標(biāo)簽:
單鏈表
上傳時(shí)間:
2017-11-15
上傳用戶:BIANJIAXIN
-
1. 編程實(shí)現(xiàn)鏈表的基本操作函數(shù)。
(1). void CreatList(LinkList &La,int m)
//依次輸入m個(gè)數(shù)據(jù),并依次建立各個(gè)元素結(jié)點(diǎn),逐個(gè)插入到鏈表尾;建立帶表頭結(jié)點(diǎn)的單鏈表La;
(2). void ListPrint(LinkList La)
//將單鏈表La的數(shù)據(jù)元素從表頭到表尾依次顯示。
(3).void ListInsert (LinkList &L,int i,ElemType e){
//在帶頭結(jié)點(diǎn)的單鏈表L中第i個(gè)數(shù)據(jù)元素之前插入數(shù)據(jù)元素e
(4). void ListDelete(LinkList &La, int n, ElemType &e)
//刪除鏈表的第n個(gè)元素,并用e返回其值。
(5). int Search(LinkList L, ElemType x)
//在表中查找是否存在某個(gè)元素x,如存在則返回x在表中的位置,否則返回0。
(6). int ListLength(LinkList L) //求鏈表L的表長
(7). void GetElem(LinkList L, int i, ElemType &e)
//用e返回L中第i個(gè)元素的值
鏈表的結(jié)點(diǎn)類型定義及指向結(jié)點(diǎn)的指針類型定義可以參照下列代碼:
typedef struct Node{
ElemType data; // 數(shù)據(jù)域
struct Node *next; // 指針域
}LNode, *LinkList;
標(biāo)簽:
單鏈表
上傳時(shí)間:
2017-11-15
上傳用戶:BIANJIAXIN
-
AEC-Q100 qualified
? 12 V and 24 V battery systems compliance
? 3.3 V and 5 V logic compatible I/O
? 8-channel configurable MOSFET pre-driver
– High-side (N-channel and P-channel MOS)
– Low-side (N-channel MOS)
– H-bridge (up to 2 H-bridge)
– Peak & Hold (2 loads)
? Operating battery supply voltage 3.8 V to 36 V
? Operating VDD supply voltage 4.5 V to 5.5 V
? All device pins, except the ground pins, withstand at least 40 V
? Programmable gate charge/discharge currents for improving EMI behavior
標(biāo)簽:
configurable
Automotive
pre-driver
suitable
channel
systems
MOSFET
fully
High
side
上傳時(shí)間:
2019-03-27
上傳用戶:guaixiaolong
-
#include<stdio.h>
#define TREEMAX 100
typedef struct BT
{
char data;
BT *lchild;
BT *rchild;
}BT;
BT *CreateTree();
void Preorder(BT *T);
void Postorder(BT *T);
void Inorder(BT *T);
void Leafnum(BT *T);
void Nodenum(BT *T);
int TreeDepth(BT *T);
int count=0;
void main()
{
BT *T=NULL;
char ch1,ch2,a;
ch1='y';
while(ch1=='y'||ch1=='y')
{
printf("\n");
printf("\n\t\t 二叉樹子系統(tǒng)");
printf("\n\t\t*****************************************");
printf("\n\t\t 1---------建二叉樹 ");
printf("\n\t\t 2---------先序遍歷 ");
printf("\n\t\t 3---------中序遍歷 ");
printf("\n\t\t 4---------后序遍歷 ");
printf("\n\t\t 5---------求葉子數(shù) ");
printf("\n\t\t 6---------求結(jié)點(diǎn)數(shù) ");
printf("\n\t\t 7---------求樹深度 ");
printf("\n\t\t 0---------返 回 ");
printf("\n\t\t*****************************************");
printf("\n\t\t 請選擇菜單號 (0--7)");
scanf("%c",&ch2);
getchar();
printf("\n");
switch(ch2)
{
case'1':
printf("\n\t\t請按先序序列輸入二叉樹的結(jié)點(diǎn):\n");
printf("\n\t\t說明:輸入結(jié)點(diǎn)(‘0’代表后繼結(jié)點(diǎn)為空)后按回車。\n");
printf("\n\t\t請輸入根結(jié)點(diǎn):");
T=CreateTree();
printf("\n\t\t二叉樹成功建立!\n");break;
case'2':
printf("\n\t\t該二叉樹的先序遍歷序列為:");
Preorder(T);break;
case'3':
printf("\n\t\t該二叉樹的中序遍歷序列為:");
Inorder(T);break;
case'4':
printf("\n\t\t該二叉樹的后序遍歷序列為:");
Postorder(T);break;
case'5':
count=0;Leafnum(T);
printf("\n\t\t該二叉樹有%d個(gè)葉子。\n",count);break;
case'6':
count=0;Nodenum(T);
printf("\n\t\t該二叉樹總共有%d個(gè)結(jié)點(diǎn)。\n",count);break;
case'7':
printf("\n\t\t該樹的深度為:%d",TreeDepth(T));
break;
case'0':
ch1='n';break;
default:
printf("\n\t\t***請注意:輸入有誤!***");
}
if(ch2!='0')
{
printf("\n\n\t\t按【Enter】鍵繼續(xù),按任意鍵返回主菜單!\n");
a=getchar();
if(a!='\xA')
{
getchar();
ch1='n';
}
}
}
}
BT *CreateTree()
{
BT *t;
char x;
scanf("%c",&x);
getchar();
if(x=='0')
t=NULL;
else
{
t=new BT;
t->data=x;
printf("\n\t\t請輸入%c結(jié)點(diǎn)的左子結(jié)點(diǎn):",t->data);
t->lchild=CreateTree();
printf("\n\t\t請輸入%c結(jié)點(diǎn)的右子結(jié)點(diǎn):",t->data);
t->rchild=CreateTree();
}
return t;
}
void Preorder(BT *T)
{
if(T)
{
printf("%3c",T->data);
Preorder(T->lchild);
Preorder(T->rchild);
}
}
void Inorder(BT *T)
{
if(T)
{
Inorder(T->lchild);
printf("%3c",T->data);
Inorder(T->rchild);
}
}
void Postorder(BT *T)
{
if(T)
{
Postorder(T->lchild);
Postorder(T->rchild);
printf("%3c",T->data);
}
}
void Leafnum(BT *T)
{
if(T)
{
if(T->lchild==NULL&&T->rchild==NULL)
count++;
Leafnum(T->lchild);
Leafnum(T->rchild);
}
}
void Nodenum(BT *T)
{
if(T)
{
count++;
Nodenum(T->lchild);
Nodenum(T->rchild);
}
}
int TreeDepth(BT *T)
{
int ldep,rdep;
if(T==NULL)
return 0;
else
{
ldep=TreeDepth(T->lchild);
rdep=TreeDepth(T->rchild);
if(ldep>rdep)
return ldep+1;
else
return rdep+1;
}
}
標(biāo)簽:
二叉樹
子系統(tǒng)
上傳時(shí)間:
2020-06-11
上傳用戶:ccccy
-
1.計(jì)算n!,并捕獲可能出現(xiàn)的異常,n的值由控制臺傳入。
2.自定義異常的定義、拋出和捕獲:
標(biāo)簽:
Java
異常處理
上傳時(shí)間:
2020-06-26
上傳用戶:hqla
-
P P I I CK I I T T3 3 使用 說明--- - 連機(jī) 、 脫 機(jī)操作試用 MPLAB IDE 軟件一 、 P P I I C CK K I I T3 接 口說 明, , 硬 件 二 、 P P I I C CK K I I T3 連 接 電腦 MPL L AB I I DE 聯(lián)機(jī)三 、 聯(lián)機(jī)四 、聯(lián)機(jī)讀芯片程序五 、 脫機(jī) 燒寫 調(diào)試
標(biāo)簽:
kit3
聯(lián)機(jī)
脫機(jī)
上傳時(shí)間:
2022-03-24
上傳用戶: