Guest User

Untitled

a guest
Jan 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public class comment {
  2. public static void main(String args[]){
  3. String[] com = new String[50];
  4. Scanner scan = new Scanner(System.in);
  5. int i = 2 ,a=0;
  6. System.out.println("Enter comment");
  7.  
  8. com[i] = scan.nextLine();
  9.  
  10. if(com[0].equals("/")){
  11. if(com[1].equals("/")){
  12. System.out.println("comment");
  13. }
  14. else if (com[1].equals("*")){
  15. for(i=2;i<=50; i++){
  16. if(com[1].equals("*") && com[i+1].equals("/") ){
  17. System.out.println("comment");
  18. a=1;
  19. break;
  20. }
  21. else{
  22. continue;}}
  23. if(a==0){System.out.println("not");}
  24. }
  25. else{System.out.println("not");
  26. }
  27. }
  28. else{System.out.println("not");
  29. }
  30. }
  31. }
  32.  
  33. if(com[0].equals("/"))
Add Comment
Please, Sign In to add comment