View Code of Problem 55

import java.util.Scanner;
 
public class Main
{
  public static void main(String[] args)
  {
    Scanner scan=new Scanner(System.in);
    String s=scan.nextLine();
    String c=scan.nextLine();
    String[] str=s.toCharArray();
    for(int i=0;i<str.length;i++)
    {
      if(str[i]!=c)
        System.out.print(str[i]);
        
    }
    
    
  }
}
/*
Main.java:10: error: incompatible types
    String[] str=s.toCharArray();
                              ^
  required: String[]
  found:    char[]
1 error
*/

Double click to view unformatted code.


Back to problem 55