Skip to content

Commit 782e44d

Browse files
committed
add hdu_2000
1 parent d57be48 commit 782e44d

4 files changed

Lines changed: 47 additions & 3 deletions

File tree

.idea/compiler.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.yiyun;
2+
3+
import java.util.Scanner;
4+
5+
public class Main {
6+
public static void main(String args[]) {
7+
Scanner cin = new Scanner(System.in);
8+
int a, b;
9+
10+
while (cin.hasNextInt()) {
11+
a = cin.nextInt();
12+
b = cin.nextInt();
13+
System.out.println(a + b);
14+
}
15+
}
16+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package hdu;
2+
3+
import java.util.Scanner;
4+
5+
public class _2000ASCIISort {
6+
public static void main(String[] args) {
7+
Scanner cin = new Scanner(System.in);
8+
String s=null;
9+
while (cin.hasNext()) {
10+
s = cin.nextLine();
11+
char[] chars = s.toCharArray();
12+
for (int i = 0; i < s.length(); i++) {
13+
for (int j = 0; j < s.length() - 1 - i; j++) {
14+
if (chars[j] > chars[j + 1]) {
15+
char tmp = chars[j];
16+
chars[j] = chars[j + 1];
17+
chars[j + 1] = tmp;
18+
}
19+
}
20+
}
21+
int i=0;
22+
for (i = 0; i < chars.length-1; i++) {
23+
System.out.print(chars[i]+" ");
24+
}
25+
System.out.println(chars[i]);
26+
}
27+
}
28+
}

myoffer/src/main/java/leetcode/array/LC_349.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class LC_349 {
77
/**
88
* @param nums1
99
* @param nums2
10-
* @return int[]
10+
* @return int[]2
1111
*/
1212
public int[] intersection(int[] nums1, int[] nums2) {
1313
HashSet<Integer> hashSet = new HashSet<>();

0 commit comments

Comments
 (0)