Help Granny cross the street
Time limit: 1.0s memory limit: 256.0MB A total of 5 red scarves, numbered A, B, C, D, E, the grandmother was one of them to help cross the road.
Five red scarves speak each other:
A: Neither I nor e have helped granny
B: Granny is a C and E, one of them helped me through the street.
C: Granny's been helped by me and D.
D:b and C are not helping granny across the street.
E: I didn't help grandma.
It is known that there are five red scarves and only 2 people are telling the truth, who helped the old lady through the street?
If there are multiple answers, output in one line, separated by a space between the numbers.
For example
A B C D E (which is obviously not the correct answer)
#include <cstdio>intMain () {intAA; intFlag =0; for(intI=0; i<5; i++) { CharCh='A'+i; intlogical= (ch! ='A'&& ch! ='E') + (ch = ='C'|| ch=='E') + (ch = ='C'|| ch=='D') + (ch!='C'&& ch!='B') + (ch!='E'); if(Logical = =2) { if(flag) {printf (" "); } printf ("%c",'A'+i); Flag=1; } } return 0;}
Help Granny cross the street