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