ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1094. E-screen

pls help what wrong
Posted by BoRN 4 Mar 2003 20:16
#include <stdio.h>

int main()
{
    char str[10010],output[80];
    int i,index=0;
    gets(str);
    for(i=0;i<80;i++)    output[i]=' ';

    for(i=0;str[i];i++){
        if((str[i]=='<')&&(index>0))    index--;
        else if(str[i]=='>')        index=
(index+1)%80;
        else{
            output[index]=str[i];
            index=(index+1)%80;
        }
    }
    for(i=0;i<80;i++)    printf("%c",output[i]);
    return 0;
}
Re: pls help what wrong
Posted by Mateusz Linda 4 Mar 2003 22:04
You have to output the screen to the maximal sign you've read -> I
mean if u've reached only the 20th position in your array u are to
output only 20 signs .
Good luck !
Re: pls help what wrong
Posted by Barnaul-Team#1(real) 11 Aug 2003 21:01
> You have to output the screen to the maximal sign you've read -> I
> mean if u've reached only the 20th position in your array u are to
> output only 20 signs .
> Good luck !
No, you are wrong! In my AC solution I output 80 symbols everytime!
your answer is wrong
Posted by 55555 16 Aug 2003 19:58
you program's output is wrong:
<Look for second hamburger at computer and chairs.790