SOLUTION INFO
C++ · main.cpp
- 작성자
- rlawngus0910
- 공동 작성자
- tony9402
#include <bits/stdc++.h>
using namespace std;
string input, s, k;
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
cin >> input >> k;
for (int i = 0; i < (int)input.length(); i++) {
if('0' <= input[i] && input[i] <= '9') continue;
s += input[i];
}
if (s.find(k) != string::npos) cout << "1";
else cout << "0";
}
SOLUTION DESCRIPTION
풀이 설명
등록된 풀이 설명이 없습니다.
SOLUTION INFO
Java · Main.java
- 작성자
- lms0806
- 공동 작성자
- 없음
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException{
FastReader rd = new FastReader();
String s = rd.nextLine().replaceAll("[0-9]", ""), k = rd.nextLine();
System.out.print(s.indexOf(k) != -1 ? 1 : 0);
}
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while(st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
}
catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() { return Integer.parseInt(next()); }
long nextLong() { return Long.parseLong(next()); }
double nextDouble() { return Double.parseDouble(next()); }
String nextLine() {
String str = "";
try {
str = br.readLine();
}
catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
}
SOLUTION DESCRIPTION
풀이 설명
등록된 풀이 설명이 없습니다.