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 1007. Code Words

2 Admins
Posted by Veniamin 9 Mar 2005 02:43
Guys, please specify input output format!
We can read in task:
“Input contains number N followed by received words. The words are delimited with line breaks. There are no more than 1000 words in the file. There is nothing else in the file, except maybe for some extra spaces or line breaks”

So, if we have to use file, give us name of this file!

Than, could you specify input/output sequence if it is standard input.
For example we have input
4
0000
011
1011
11011

So, it means that in console it will looks like:
4    //IN
0000 //IN
0000 //OUT
011  //IN
0110 //OUT
1011 //IN
1001 //OUT
11011//IN
1111 //OUT

or
4    //IN
0000 //IN
011  //IN
1011 //IN
11011//IN

0000 //OUT
0110 //OUT
1001 //OUT
1111 //OUT


1.    So, please specify input (file or standard)?
2.    If input is file – give us name!
3.    Show sequence of output
INPUT and OUTPUT are independent streams
Posted by Ves 9 Mar 2005 05:24
So
4 //IN
0000 //IN
0000 //OUT
011 //IN
0110 //OUT
1011 //IN
1001 //OUT
11011//IN
1111 //OUT

and
4 //IN
0000 //IN
011 //IN
1011 //IN
11011//IN

0000 //OUT
0110 //OUT
1001 //OUT
1111 //OUT
will give the same result.
Re: INPUT and OUTPUT are independent streams
Posted by Veniamin 9 Mar 2005 12:25
Т.е. на С это будет выглядить примено так:
#include <iostream.h>
int main()
{
   int N;
....
   cin >> N
   while(...)
   {
       cin >> WordIN;
....
       cout << WordOut;
   }

   return 0;
}
И ещё - как определить конец ввода?Если есть ASC2 код этого символа, то распишите его....
Re: INPUT and OUTPUT are independent streams
Posted by Ves 11 Mar 2005 06:05
In the end of input there is always a symbol with ASCII code 26. You can use EOF in C or Pascal.