Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package cadenas;
- import java.util.Scanner;
- import java.io.IOException;
- /**
- *
- * @author JesseKislev
- */
- public class Cadenas {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args)throws IOException {
- Scanner leer = new Scanner(System.in);
- String x, y;
- String w="123";
- System.out.println("Ingresa una cadena");
- x = leer.nextLine();
- for(int x1=0; x1<x.length(); x1++){
- char b = x.charAt(x1);
- for(int z=0; z<w.length(); z++){
- char a = w.charAt(z);
- if(a==b){
- System.out.println(b);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement