fork download
  1. class M{
  2. static String c(String s){
  3. char[] a = s.toCharArray();
  4. return "User: " + f(a[0]) + "Group: " + f(a[1]) + "Others: " + f(a[2]);
  5. }
  6.  
  7. static String f(int i){
  8. return new String[]{ "None", "Execute only", "Write only", "Write and Execute", "Read only", "Read and Execute", "Read and Write", "Read Write and Execute" }
  9. [i % 48] + "\n";
  10. }
  11.  
  12. public static void main(String[] a){
  13. System.out.println(c("666"));
  14. System.out.println(c("042"));
  15. System.out.println(c("644"));
  16. }
  17. }
Success #stdin #stdout 0.04s 712192KB
stdin
Standard input is empty
stdout
User:   Read and Write
Group:  Read and Write
Others: Read and Write

User:   None
Group:  Read only
Others: Write only

User:   Read and Write
Group:  Read only
Others: Read only