UVa 11917-do Your Own Homework

Source: Internet
Author: User

Title: Soha have a lot of homework to write, and Sparrow will help him, but each homework to a certain time to complete,

Now give you need to hand in the homework and time limit, ask can be completed, within 5 days after the deadline to pay late.

Analysis: Simple questions, strings. String the same number of days to compare.

Description: ╮(╯▽╰)╭.

#include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include < Cstdio> #include <cmath>using namespace Std;char work[505][22],test[22];int  days[505],day;int main () { int T,n;while (~SCANF ("%d", &t)) for (int T = 1; t <= t; + + t) {scanf ("%d", &n), for (int i = 0; i < n; + + i) SC ANF ("%s%d", Work[i],&days[i]); scanf ("%d%s", &day,test);p rintf ("Case%d:", t); int get = 0;for (int i = 0; I < n; + + i) if (!strcmp (test, work[i])) {if (Days[i] <= day+5) {if (Days[i] <= day) puts ("yesss"); else puts ("late"); get = 1 ;}} if (!get) puts ("Do your own homework!");}    return 0;}


UVa 11917-do Your Own Homework

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.