Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- #include<stdlib.h>
- int main()
- {
- char subject[110][25],due[25];
- int D,t,n,day[110],i,j,flag,ca=0,x,y;
- scanf("%d",&t);
- for(x=0; x<t; x++)
- {
- scanf("%d",&n);
- i = 0;
- for(y=0; y<n; y++)
- {
- scanf("%s %d",subject[i],&day[i]);
- i++;
- }
- scanf("%d",&D);
- scanf("%s",due);
- flag = 0;
- printf("Case %d: ",++ca);
- for(j=0; j<i; j++)
- {
- if( strcmp(due,subject[j]) == 0)
- {
- flag = 1;
- if( day[j] < D )
- {
- printf("Yesss\n");
- }
- else if( day[j] <= (D+5) )
- {
- printf("Late\n");
- }
- else
- {
- printf("Do your own homework!\n");
- }
- break;
- }
- }
- if(flag == 0)
- {
- printf("Do your own homework!\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement