Created
January 10, 2016 17:04
-
-
Save Jack-Saleem/a645ce5fff4b22c57f9c to your computer and use it in GitHub Desktop.
Codeforces 258A LittleElephantAndBits program in java
This file contains hidden or 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
import java.util.Scanner; | |
public class LittleElephantAndBits | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
String y=z.next(); | |
StringBuilder sb=new StringBuilder(y); | |
if(y.contains("0")) | |
{ | |
for(int i=0;i<sb.length();i++) | |
{ | |
if(sb.charAt(i)=='0') | |
{ | |
sb.deleteCharAt(i); | |
break; | |
} | |
} | |
System.out.println(sb); | |
} | |
else | |
System.out.println(sb.deleteCharAt(0)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment