fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14.  
  15. int[] f(String b,int s){int i=0,o[]=new int[b.length()*8/s+1],a=0;String x="",t;for(String c:b.toCharArray()){t=Integer.toString(c.charAt(0),2);while(t.length()<8)t="0"+t;x+=t;a+=8;while(a>=s){o[i++]=Integer.parseInt(x.substring(0,s),2);x=x.substring(s,a);a-=s;}}while(a++<s)x+="0";o[i]=Integer.parseInt(x,2);return o;}
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:15: error: incompatible types: char cannot be converted to String
	int[] f(String b,int s){int i=0,o[]=new int[b.length()*8/s+1],a=0;String x="",t;for(String c:b.toCharArray()){t=Integer.toString(c.charAt(0),2);while(t.length()<8)t="0"+t;x+=t;a+=8;while(a>=s){o[i++]=Integer.parseInt(x.substring(0,s),2);x=x.substring(s,a);a-=s;}}while(a++<s)x+="0";o[i]=Integer.parseInt(x,2);return o;}
	                                                                                                          ^
1 error
stdout
Standard output is empty