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

BoRN pls help i got WA for about 7 time [2] // Problem 1094. E-screen 9 Oct 2002 20:50
#include <stdio.h>

char ans[80];

int main()
{
    int i,current=0,maxreach=0;
    char ch;
    for(i=0;i<80;i++)
        ans[i]=' ';
    while((ch=getc(stdin))!=-1){
        if(ch=='\n')    NULL;
        else if(ch=='<'){
            if(current>0)    current-=1;
        }
        else if(ch=='>'){
            if(current>maxreach)
    maxreach=current;
            if(current<79)    current+=1;
            if(current=79)    current=0;
        }
        else{
            if(current>maxreach)
    maxreach=current;
            ans[current]=ch;
            current=(current+1)%80;
        }
    }
    for(i=0;i<=maxreach;i++)
        printf("%c",ans[i]);
    return 0;
}
Knot Skycreeper[th] Re: pls help i got WA for about 7 time [1] // Problem 1094. E-screen 10 Oct 2002 21:16
hey,, piched

it says: "INPUT: The single line of the input contains a sequence of..."

it says: "SINGLE LINE OF INPUT"

i think this would help you...
> hey,, piched
>
> it says: "INPUT: The single line of the input contains a sequence of..."
>
> it says: "SINGLE LINE OF INPUT"
>
> i think this would help you...