fork(2) 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 i,t,j,x;
  13. String s;
  14. Scanner in=new Scanner(System.in);
  15. t=in.nextInt();
  16. in.nextLine();
  17. for(i=0;i<t;i++){ x=0;
  18. s=in.nextLine();
  19. if(s.charAt(s.length()-4)==' '&&s.charAt(s.length()-3)=='n'&&s.charAt(s.length()-2)=='o'&&s.charAt(s.length()-1)=='t')
  20. System.out.println("Real Fancy");
  21. else {
  22. if(s.charAt(0)=='n'&&s.charAt(1)=='o'&&s.charAt(2)=='t'&&s.charAt(3)==' ')
  23. System.out.println("Real Fancy");
  24. else{
  25. for(j=0;(j<s.length()-4)&&x==0;j++){
  26. if(s.charAt(j)==' '&&s.charAt(j+1)=='n'&&s.charAt(j+2)=='o'&&s.charAt(j+3)=='t'&&s.charAt(j+4)==' ')
  27. {System.out.println("Real Fancy"); x=1;}
  28. }
  29. if(x==0) System.out.println("regularly fancy");
  30. }
  31. }
  32. }
  33. }
  34. }
Success #stdin #stdout 0.07s 2184192KB
stdin
5
i do have any fancy quotes not
when nothing goes right go left
please note that
notpile upon not
not all are good
stdout
Real Fancy
regularly fancy
regularly fancy
Real Fancy
Real Fancy