# 目录

• 1.星期计算
• 2.考勤刷卡
• 3.打卡

### 1.星期计算

``````package lanqiaobei.exe.day05;

public class 数的分解 {
public static void main(String[] args) {
int res =  0;
for(int i = 1; i < 2019;  i++){
if(!pd(i))continue;
for(int j = i + 1;  j <= 2019 - i; j ++){
if(!pd(j))continue;
for(int k = j + 1; k <= 2019 - j; k++){
if (!pd(k))continue;
if (i + j + k == 2019){
res++;
}
}
}
}
System.out.println(res);
}

static boolean pd(int num){
while(num != 0){
if(num % 10 == 2 || num % 10 == 4)return false;
num /= 10;
}
return true;
}
}
``````

### 2.考勤刷卡

``````import java.io.*;
import java.util.*

public class 考勤刷卡 {

public static void main(String[] args) throws IOException {
int n = Integer.parseInt(br.readLine());
TreeSet<Integer> set = new TreeSet<>();
while (n -- != 0){
String[] s = br.readLine().split(" ");
}
for (int ans:set) System.out.println(ans);

}
}
``````

### 3.打卡

``````import java.util.Scanner;

public class 卡片 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for(int i = 1;;i++){
if(i * (i + 1) >= 2 * n) {
System.out.println(i);
break;
}
}

}
}
``````
...全文
11 回复 打赏 收藏 举报

4.2w+

2023-03-08 23:06

刷题！