第一次作业

master
csxy 5 months ago
commit 7d16d94923

38
.gitignore vendored

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,3 @@
<component name="ProjectDictionaryState">
<dictionary name="尘世闲游" />
</component>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,8 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ADDITIONAL_TAGS" value="date:,author:,Content:" />
</inspection_tool>
</profile>
</component>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.heima.springboot</groupId>
<artifactId>lanqiaobei</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

@ -0,0 +1,36 @@
package com.heima.springboot;
import java.util.Scanner;
/**
* @version 1.0
* @author: HZY
* @date: 2025/3/13 21:23
* @Content:
* C1 = aababdbdaabc
* C2 = aabc
*/
public class Code2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = null;
s = sc.next();
String c = null;
c = sc.next();
char[] c1 = c.toCharArray();
char[] s1 = s.toCharArray();
int []next = new int[c.length()];
next[0] = 0;
next[1] = 1;
for (int i = 0; i < s.length(); i++) {
if(i==0) {
continue;
}
char []codeQ = new char[i-1];
char []codeH = new char[i-1];
}
}
}

@ -0,0 +1,29 @@
package com.heima.springboot;
/**
* @version 1.0
* @author: HZY
* @date: 2025/3/12 19:36
* @Content:
*/
public class Main {
public static void main(String[] args) {
Hanoi hanoi = new Hanoi();
int n = 3; // 盘子数
hanoi.move(n, 'A', 'C', 'B');
}
}
class Hanoi {
public void move(int n, char A, char C, char B) {
if (n == 1) {
System.out.println(A + " -> " + C);
return;
}
//借和栈
//借用B,
move(n - 1, A, B, C); //把A上面的除了最后一个的所有挪到B
System.out.println(A + " -> " + C); //A的最后一个去C
move(n - 1, B, C, A); //把从A那拿的都给C
}
}

@ -0,0 +1,24 @@
package com.heima.springboot;
/**
* @version 1.0
* @author: HZY
* @date: 2025/3/12 19:36
* @Content:
*/
public class Table {
private int data;
public Table(int data) {
this.data = data;
}
public int getData() {
return data;
}
public void setData(int data) {
this.data = data;
}
}

@ -0,0 +1,26 @@
package com.heima.springboot;
import java.math.BigInteger;
import java.sql.SQLOutput;
/**
* @version 1.0
* @author: HZY
* @date: 2025/3/17 17:18
* @Content:
*/
public class Test {
public static void main(String[] args) {
long a = 4;
long b = 1;
BigInteger c = BigInteger.ZERO;
long l = System.currentTimeMillis();
for (long i = 1; i <= a; i++) {
b *= i;
c = c.add(new BigInteger("" + b));
}
System.out.println(b);
System.out.println(c);
System.out.println(System.currentTimeMillis() - l);
}
}

@ -0,0 +1,67 @@
package com.heima.springboot;
import java.util.Scanner;
/**
* @version 1.0
* @author: HZY
* @date: 2025/3/17 21:22
* @Content:
* s 0 n n / 2 '[' n / 2 ']'
* <p>
*
* <p>
*
* AB A B
* [C] C
*
* <p>
* 使 s
* <p>
* <p>
* <p>
* 1
* <p>
* s = "][]["
* 1
* 0 3 使
* "[[]]"
* 2
* <p>
* s = "]]][[["
* 2
* 使
* - 0 4 s = "[]][]["
* - 1 5 s = "[[][]]"
* "[[][]]"
* 3
* <p>
* s = "[]"
* 0
*
*/
public class likou1 {
public static void main(String[] args) {
//1为【-1为】
int judging = 0;
/*
a
*/
int a = 0;
/*
b
*/
int b = 0;
String s = new Scanner(System.in).next();
char[] sCharArray = s.toCharArray();
for (int i = 0; i < sCharArray.length; i++) {
if (sCharArray[i] == ']') {
for (int j = sCharArray.length; j > 0; j--){
if(sCharArray[j-1] == '['){
judging++;
}
}
}
}
}
}
Loading…
Cancel
Save