This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String contents = "Yes, you can!" | |
StringBuilder sb = new StringBuilder(); | |
sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); | |
sb.append("<!DOCTYPE en-note SYSTEM " + "\"http://xml.evernote.com/pub/enml2.dtd\">"); | |
sb.append("<en-note>"); | |
sb.append(contents); | |
sb.append("</en-note>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
String line = br.readLine(); | |
String s = line; //IPアドレス | |
String[] s_array = s.split("\\."); | |
for(int i = 0; i < s_array.length; i++){ | |
if(s_array[i].indexOf("[") >= 0){ | |
int _a = s.indexOf("["); | |
int _b = s.indexOf("]"); | |
String ab = s.substring(_a + 1, _b); //範囲指定があったときの中の文字列 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
String line = br.readLine(); | |
int Q = Integer.parseInt(line); //判定したい整数の個数 Q | |
for(int i = 0; i < Q; i++){ | |
line = br.readLine(); | |
int N = Integer.parseInt(line); | |
ArrayList<Integer> array = new ArrayList<Integer>(); | |
for(int j = 1; j < N; j++){ | |
if(N % j == 0){ | |
array.add(j); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
String line = br.readLine(); | |
StringBuffer sb = new StringBuffer(); | |
for(int i = 0; i < line.length(); i++){ | |
String str = line.substring(i,i+1); | |
if(str.equals("A")){ | |
sb.append(4); | |
} else if(str.equals("E")){ | |
sb.append(3); | |
} else if(str.equals("G")){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
String line = br.readLine(); | |
int N = Integer.parseInt(line); //各レシートの数 | |
int allPoints = 0; | |
for(int i = 0; i < N; i++){ | |
line = br.readLine(); //n行目 | |
String[] s_str = line.split(" "); | |
String d = s_str[0]; //レシートの日付 | |
double p = Integer.parseInt(s_str[1]); //購入金額 | |
if(d.matches(".*5.*")){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
String line = br.readLine(); | |
String n = line; //嫌いな数字 | |
line = br.readLine(); | |
int m = Integer.parseInt(line); //病室の総数 | |
ArrayList<String> array = new ArrayList<String>(); | |
for(int i = 0; i < m; i++){ | |
line = br.readLine(); //m行 | |
array.add(line); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
String line = br.readLine(); | |
String[] str = line.split(" "); | |
int a = Integer.parseInt(str[0]); //工事現場のx座標 | |
int b = Integer.parseInt(str[1]); //工事現場のy座標 | |
int R = Integer.parseInt(str[2]); //工事現場の騒音の大きさ | |
line = br.readLine(); //2行目 | |
int N = Integer.parseInt(line); //木陰の数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
String line = br.readLine(); | |
String[] str = line.split(" "); | |
String s = br.readLine(); //2行目の文字列 | |
String a = str[0]; //タグA | |
String b = str[1]; //タグB | |
int _a = s.indexOf(a, 0); //Aが出る場所 | |
int _b = s.indexOf(b, _a); //Bが出る場所 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<EditText android:imeOptions="actionSearch" | |
android:inputType="text"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { | |
@Override | |
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { | |
if (actionId == EditorInfo.IME_ACTION_SEARCH) { | |
performSearch(); | |
return true; | |
} | |
return false; | |
} | |
}); |
NewerOlder