Sunday, June 7, 2020

Real Fancy in C++

A program was written by my friend Thomas to test real fancy in C++. 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

/*
Chef was reading some quotes by great people.
Now, he is interested in classifying all the fancy quotes
he knows. He thinks that all fancy quotes which contain
the word "not" are Real Fancy;
quotes that do not contain it are regularly fancy.
You are given some quotes.
For each quote, you need to tell Chef if it is Real Fancy
or just regularly fancy.

https://www.codechef.com/problems/FANCY
*/

#include <iostream>
#include <string>
#include <cstdio>
#include <sstream>

const std::size_t MAX_INPUT_LENGTH = 100;

inline void do_test()
{
  std::string input;
  input.reserve(MAX_INPUT_LENGTH);
  std::getline(std::cin, input);
  std::istringstream iss(input);
  std::string token;
  while (iss >> token)
  {
    if (token == "not")
    {
      std::cout << "Real Fancy\n";
      return;
    }
  }

  std::cout << "regularly fancy\n";
}

int main()
{
  int num_tests;

#ifdef ONLINE_JUDGE
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
#else
  std::freopen("input.txt", "r", stdin);
#endif

  std::cin >> num_tests;
  std::cin.ignore(255, '\n');

  for (int n = 0; n < num_tests; n++)
  {
    do_test();
  }
}





No comments:

Post a Comment