UVa 576-haiku Review

Source: Internet
Author: User

Title: give you three sentences to determine whether the number of consecutive vowels (including y) in three sentences is 5,7,5.

Analysis: A simple question. can be solved directly.

stating: ╮(╯▽╰)╭.

#include <cstdio> #include <cstring>int  maps[256];int  size[3];char buf[202];int Main () {memset ( Maps, 0, sizeof (maps)), maps[' a '] = maps[' e '] = maps[' i '] = maps[' o '] = maps[' u '] = maps[' y '] = 1;while (gets (BUF)) {if (!s TRCMP (buf, "e/o/i")) break;int item = 0;size[0] = size[1] = size[2] = 0;for (int i = 0; buf[i]; + + i) {if (buf[i] = = '/') + + item;if (i = = 0 | |!maps[buf[i-1]]) Size[item] + + maps[buf[i]];} if (size[0]! = 5) puts ("1"), else if (size[1]! = 7) puts ("2"), else if (size[2]! = 5) puts ("3"); else puts ("Y");}    return 0;}

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

UVa 576-haiku Review

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.