- 博客(33)
- 收藏
- 关注
原创 四
[root@localhost ~]# ! /bin/bashcase "$1" in[root@localhost ~]# case "$1" in> start)> echo "Starthing ABC service"> ;;> stop)> echo "Stop ABC service"> ;;> force-relonad|...
2019-12-22 21:53:46
165
原创 Linux第三次
[root@localhost ~]# lsdos hello.c[root@localhost ~]# mkdir vitest[root@localhost ~]# lsdos hello.c vitest[root@localhost ~]# mkdir ~/vitest/inittab[root@localhost ~]# lsdos hell...
2019-12-22 21:24:03
160
原创 linux第二次
[root@localhost ~]# find / -name lib -print >> test[root@localhost ~]# lsdos hello.c test[root@localhost ~]# head test/var/lib/lib/usr/local/lib/usr/lib/usr/lib/perl5/5.22.2/unicor...
2019-12-22 20:54:48
169
原创 图形用户界面编辑
package texet;import javax.swing.*;import java.awt.*;public class text extends JFrame {public text(){this.setTitle("第一个界面");this.setBounds(300, 300, 600, 450);this.setDefaultCloseOperation(thi...
2019-12-06 16:32:54
198
原创 java异常处理
package maxt;public class asdd { public static void main(String[] args){ try{ int a=args.length; System.out.println("\na = "+ a); int b=42/a; int c[]={1}; c[42]=99; }catch(Arithm...
2019-11-22 16:16:28
106
原创 linux第一次实验
[root@localhost ~]# pwd/root[root@localhost ~]# mkdir -p ~/home/jxnc[root@localhost ~]# cd home[root@localhost home]# lsjxnc[root@localhost home]# cd ~[root@localhost ~]# lsdos hello.c h...
2019-10-29 11:35:56
192
原创 线性表
#include<stdio.h>#include<stdlib.h>void ListInitiate(SeqList *L){L->size=0;}int ListLength(SeqList L){return L.size;}int ListInsert(SeqList *L,int i,DataTye x){int j;if(L-&g
2019-10-25 17:24:56
109
原创 将两个有序单链表合并
#include<stdio.h>#include<stdlib.h>#include<malloc.h>typedef struct node*List;struct node{int data;struct node *next;};List Read(){int x;List q,r ,head;scanf_s("%d",&...
2019-10-25 17:24:34
122
原创 图
#include<stdio.h>#include<stdlib.h>typedef char DataType;typedef int SeqList;#define MaxSize 10#define MaxVertices 10#define MaxWeight 10000typedef struct{ SeqList Vertices; int ...
2019-10-25 17:23:55
101
原创 遍历二叉树
#include<stdio.h>#include<stdlib.h>#include<math.h>#define MAX_TREE_SIZE 100#define OK 1#define OFFOR 0typedef TElemType SqBiTree[MAX_TREE_SIZE];SqBiTree bt;typedef int Statu...
2019-10-25 17:23:36
111
原创 普利莫算法
.cpp#include<stdio.h>#include<stdlib.h>#define Maxsize 10#define MaxVertices 10#define MaxEdges 100#define MaxWeight 1000#define MaxQueueSize 10typedef char DataType;typedef char ...
2019-10-25 17:23:06
269
原创 归并排序
void Merg(datatype a[], int n,datatype swap[],int k) { //归并排序 int m = 0, u1, u2, i, j, l2; int l1 = 0; while (l1 + k <= n - 1) { l2 = l1 + k; u1 = l2 - 1; u2 = (l2 + k - 1 <= n - 1...
2019-10-25 17:22:31
103
原创 java静态成员和实例成员
package asdm;public class Texdt { static int nStance; private static int nInstance; public static int getStatic(){ return nStance; } public static void setStatic(int newX){ nInstance=newX;...
2019-10-15 11:35:24
444
原创 创建Java类
package asdm;public class Texdt { private int nInstance; public String getInstance; public int getInstance(){ return nInstance; } public void setInstance(int newY){ nInstance=newY; }}cla...
2019-10-15 11:18:41
141
原创 Java的Math类
package asdm;import java.util.Random;public class Texdt { public static void main(String[] args){ Random r1=new Random(1234567890L); Random r2=new Random(1234567890L); boolean b=r1.nextBool...
2019-10-15 10:55:56
134
原创 java的枚举类型
package asdm;enum Color{ RED, GREEN, BLUE;}public class Texdt { public static void main(String[] args){ showColor(Color.RED); } public static void showColor(Color color){ switch(color){ ...
2019-10-15 10:35:32
129
原创 Java字符串
package text;class asdf { private String str; public String getStr(){ return str; } public void serStr(String str){ this.str=str; } public String reverse(String s){ int len=s.length(); ...
2019-10-11 17:30:43
127
原创 Java二维数组行、列互换
package text;public class asd { public static void main(String args[]){ int array[][]={{2,3,4},{5,6,7}}; int a[][]=new int[3][2]; System.out.println("源数组输出:"); for(int i=0;i<array.length...
2019-10-11 17:12:36
1868
1
原创 输出二维数组每行的列数
package text;public class asd { public static void main(String[] args){ int[][] a={ {1,2,3,4,5}, {2,3,4,5}, {3,4,5}, {4,5}, {5}}; System.out.println("the length of a is"+a.l...
2019-10-11 16:55:37
801
原创 数组名之间的复制
package text;public class asd { public void output(String arrayName,int temp[]){ int i; for(i=0;i<temp.length;i++){ System.out.println(arrayName +"["+i+"]="+temp[i]); } } public stati...
2019-10-11 16:46:56
110
原创 Java数列【Fibonacci 数列前十个数】
package text;public class asd { public static void main(String[] args){ int i; int f[]=new int[10]; f[0]=1; f[1]=1; for(i=2;i<f.length;i++){ f[i]=f[i-1]+f[i-2]; } for(i=1;i<=...
2019-10-11 16:29:48
1399
原创 java时间类
package aad;import java.text.*;import java.util.*;import java.text.DateFormat;public class gj { public static void main(String args[]){ Date today; DateFormat f1, f2; String s1; String s2...
2019-10-08 10:42:01
214
原创 顺序查找and排序and折半查找
#include<stdio.h>#include<stdlib.h>int searchItem(int arr[],int len, int value){ int low = 0,high = len-1,mid; while (low <= high) { mid = (low + high)/2; if ...
2019-06-03 15:07:57
198
原创 矩阵相乘以及转置
#include<stdio.h>#include<stdlib.h>int main(){ int a[3][3],b[3][3],c[3][3]; int i,j,k; printf("please input a:"); for(i=0;i<3;i++){ for(j=0;j<3;j++){ scanf_s("%d",&a[i...
2019-05-06 14:58:48
4254
1
原创 串的取子以及插入
#include<stdio.h>#include<string.h>#include<stdlib.h>#include<malloc.h>typedef char Elemtype;typedef int Status;typedef struct {Elemtype *ch; //指针域,指向存放串值的存储空间基址 i...
2019-04-23 20:39:53
169
原创 c++
#include#includeusing namespace std;int main(){int i=1;do{int j=1,k=1;do{cout<<" “;j++;}while(j<=9-i);do{cout<<”*";k++;}while(k<=i);cout<<endl;i++;}while(i<...
2019-03-25 17:09:01
126
1
原创 c++十六进制转十进制
#include#include&amp;lt;math.h&amp;gt;#include#includeint main(){using namespace std;string s;int i=0,count,sum;while(getline(cin,s)){int count=s.length();sum=0;for(i=count-1;i&amp;gt;=0;i–){if(s[i]&
2019-03-11 17:08:50
654
1
原创 c++十进制转十六进制
十六进制转十进制#include#includeint main(){using namespace std;int i=0,n,m,num[100];char hex[16]={‘0’,‘1’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’,‘8’,‘9’,‘A’,‘B’,‘C’,‘D’,‘E’,‘F’};cout&amp;lt;&amp;lt;“please a number.”&amp;lt;&amp;lt;.
2019-03-11 17:08:08
35610
8
原创 起泡法
#include&lt;stdio.h&gt;#include&lt;stdlib.h&gt;#include&lt;string.h&gt;char str[10];int main(){void sort(char[]);int i,flag;for(flag=1;flag==1;){printf(“input string:\n”);scanf("%
2018-12-12 11:10:10
1236
1
原创 小错误
简单实验,粗心造成失误#include&amp;amp;amp;lt;stdio.h&amp;amp;amp;gt;#include&amp;amp;amp;lt;stdlib.h&amp;amp;amp;gt;int main(){int a, b, n;int sum = 0;printf(“输入a的值和位数n:”);scanf_s(&amp;amp;quot;%d,%d&am
2018-11-25 20:42:32
212
原创 c小姐的爱宠——c语言笔记
我的c语言笔记——或与且&amp;&amp;表示且,一假全假||表示或,一真全真在c语言逻辑里,先运行非(!)后且(&amp;&amp;)再或(||)a为真,b为真,a&amp;&amp;b为真,a||b为真a为真,b为假,a&amp;&amp;b为假,a||b为真a为假,b为假,a&amp;&amp;b为假,a||b为假
2018-11-18 00:03:49
264
原创 (一)补充篇
**回文数(正确判断方法)****#include<stdio.h>#include<stdlib.h>int main(void){int a, b;int sum = 0;scanf_s("%d", &a);b = a;while (b){sum = sum * 10 + b % 10;b = b / 10;}****if (sum...
2018-11-10 10:23:02
1961
原创 我的c语言(一)
我的c语言 (first)回文数:#include&lt;stdio.h&gt;#include&lt;stdlib.h&gt;int main(void){int a, b;int sum = 0;scanf_s("%d", &amp;a);b = a;while (b){sum = sum * 10 + b % 10;b = b / 10
2018-11-09 22:29:33
377
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人