本帖最後由 李泳霖 於 2022-12-24 10:08 編輯
c462: apcs 交錯字串 (Alternating Strings)
1061028APCS實作題_2.pdf
- [code]import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class P1 {
- BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
- int k;
- String str;
- int keep;
- int count;
- int max;
- P1() throws IOException {
- k=Integer.parseInt(br.readLine());
- str=br.readLine();
- int start=tell(str.charAt(0));
- for (int i = 1; i < str.length(); i++) {
- }
- }
- int tell(char c)
- {
- if (Character.isUpperCase(c)) {
- return 1;
- }else {
- return 0;
- }
- }
- public static void main(String[] args) throws IOException {
- new P1();
- }
- }
複製代碼 [/code] |