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. int numTables = 16;
  13. String list = "Mom, Dad, Krissy, Tommy S, Joe B, Cathy B, Mary & Rich B, Tom B Sr. & Adela, Vinny & Jen, Tristan, Mckenzie, Denver, Tommy B Jr., Everett, Eliot, Tina & Aleah & Amelia, Uncle Walter & Aunt Maureen, Aunt Barbara D, Jon S & guest, Paulina, Barbara S, Caitlin & Will, Gillian, Ryan, Mark L";
  14. String[] guest = list.split(", ");
  15. System.out.println(guest.length+" guests.");
  16. for(int fix=0; fix<(guest.length); fix++)
  17. {
  18. if(guest[fix].contains(" &"))
  19. { guest[fix]=guest[fix].replace(" &", ",");}
  20. System.out.print("\""+guest[fix]+"\", ");
  21. }
  22. /*
  23. for(int one=0; one<numTables; one++)
  24. {
  25. for(int two=1; two<12; two++) // 12 at a table
  26. {
  27. System.out.print("▪︎");
  28. if(guest.length == ((11*one)+two)-1)
  29. { break; }
  30. System.out.print(((11*one)+two));
  31. //guest[((11*one)+two)]+", "); //
  32. } System.out.println("•");
  33. }*/
  34. }
  35. }
Success #stdin #stdout 0.18s 57800KB
stdin
Standard input is empty
stdout
25 guests.
"Mom", "Dad", "Krissy", "Tommy S", "Joe B", "Cathy B", "Mary, Rich B", "Tom B Sr., Adela", "Vinny, Jen", "Tristan", "Mckenzie", "Denver", "Tommy B Jr.", "Everett", "Eliot", "Tina, Aleah, Amelia", "Uncle Walter, Aunt Maureen", "Aunt Barbara D", "Jon S, guest", "Paulina", " Barbara S", "Caitlin, Will", "Gillian", "Ryan", "Mark L",