Sunday, June 7, 2020

Real Fancy in Java

A program was written by my friend Thomas to test real fancy in Java programming language. Thank you Thomas for sharing your code to us.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Program Listing

SOLUTION 1

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
     public static void main (String[] args) throws java.lang.Exception
     {
         // your code goes here
         java.io.BufferedReader r = new java.io.BufferedReader
         (new java.io.InputStreamReader (System.in));
         int T = Integer.parseInt(r.readLine());
         for(int l=0;l<T;l++) {
             String st = r.readLine();
             String[] s = st.split(" ");String ans="regularly fancy";
             for(int i=0;i<s.length;i++){
                 if(s[i].equals("not")){ans="Real Fancy";break;}
             }System.out.println(ans);
             }
     }
}

SOLUTION 2

import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
     public static void main (String[] args) throws java.lang.Exception
     {
         try{
             Scanner scan=new Scanner(System.in);
         int t=scan.nextInt();
      scan.nextLine();
         while (t-- > 0) {
             String[] words = scan.nextLine().split(" ");
             String ans = "regularly fancy";
             for (String s : words) {
                 if (s.equals("not")) {
                     ans = "Real Fancy";
                     break;
                 }
             }
             System.out.println(ans);
      }
         }catch(Exception e){
             System.out.println(e);
         }
}
}

No comments:

Post a Comment