Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. public class Dispersia {
  2. public static void main(String[] args) {
  3. Scanner in = new Scanner(System.in);
  4. }
  5. public int Plus(int a, int b){
  6. return a+b;
  7. }
  8. public String printTextPerRole(String[] roles, String[] textLines) {
  9. StringBuilder res = null;
  10. for(int i =0; i <roles.length; i++){
  11. roles[i] = roles[i] + ":";
  12. }
  13. for(int j =0; j < roles.length; j++){
  14. for(int i = 0; i < textLines.length; i++){
  15. if(textLines[i].startsWith(roles[j])){
  16. res.append(roles[i]);
  17. textLines[i].replaceFirst(roles[j],"");
  18. res.append(i);
  19. res.append(")");
  20. res.append(textLines[i]);
  21.  
  22. }
  23. }
  24. }
  25. return res.toString();
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement