TOPIC

Wrong Answer (20%)

Felipe asked 11 months ago

Alguém poderia me dar uma dica? Está dando Wrong Answer (20%)

Uses sysutils;

var 
rajesh, sheldon:string;
i, C:integer;
begin 
    readln (C);
    for i := 1 to C do
        begin 
        readln (rajesh);
        readln (sheldon);
            if AnsiCompareStr(rajesh,'tesoura') = 0 then
            begin 
                if AnsiCompareStr(sheldon,'papel') = 0 then
                begin
                writeln ('rajesh');
                end;
                if AnsiCompareStr(sheldon,'lagarto') = 0 then
                begin
                writeln ('rajesh');
                end;
            end;
            if AnsiCompareStr(rajesh,'papel') = 0 then
            begin 
                if AnsiCompareStr(sheldon,'pedra') = 0 then
                begin
                writeln ('rajesh');
                end;
                if AnsiCompareStr(sheldon,'spock') = 0 then
                begin
                writeln ('rajesh');
                end;
            end;
            if AnsiCompareStr(rajesh,'pedra') = 0 then
            begin 
                if AnsiCompareStr(sheldon,'lagarto') = 0 then
                begin
                writeln ('rajesh');
                end;
                if AnsiCompareStr(sheldon,'tesoura') = 0 then
                begin
                writeln ('rajesh');
                end;
            end;
            if AnsiCompareStr(rajesh,'lagarto') = 0 then
            begin 
                if AnsiCompareStr(sheldon,'spock') = 0 then
                begin
                writeln ('rajesh');
                end;
                if AnsiCompareStr(sheldon,'papel') = 0 then
                begin
                writeln ('rajesh');
                end;
            end;
            if AnsiCompareStr(rajesh,'spock') = 0 then
            begin 
                if AnsiCompareStr(sheldon,'tesoura') = 0 then
                begin
                writeln ('rajesh');
                end;
                if AnsiCompareStr(sheldon,'pedra') = 0 then
                begin
                writeln ('rajesh');
                end;
            end;
            if AnsiCompareStr(rajesh,sheldon) = 0 then
            begin
                writeln ('empate');
            end
            else
            begin
                writeln ('sheldon');
            end;
        end;
end.

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.