Central European Olympiad in Informatics 2004 University of Information Technology and Management, July 2004, Rzeszów, Poland |
| General informationOn-line competition startedThe trial session of the on-line competition has been started. Visit the contest web page http://sio.mimuw.edu.pl/ceoi2004/ in order to participate on-line. First, you have to register (find the link Registration). Follow the link Tasks to see the tasks. After you login, use the link Submit Solutions to submit your solution. Internet contest will be organized together with CEOI 2004 on-site competition. The online contest starts three hours after the local competition and consists of 2 rounds (24 hours each). It starts on 14th July 2004, 12.00am (CEST) and ends on 16th July 2004, 12.00am (CEST). CompilersThe only allowed programming language is Java (programs will be tested with Sun JDK v. 1.4.2_04).Each solution must conform to the following specification (suppose that we write a solution for task ABC):
Sample programsSquare (squ)ProblemWrite a program, that reads an integer x from the standard input (-100 <= x <= 100) and writes on the standard output the value x*x. Solution in Java (file SQU.java)import java.io.*; import java.util.*; public class SQU { public static void main(String[] args) { try { BufferedReader rd=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer t=new StringTokenizer(rd.readLine()); int x=Integer.parseInt(t.nextToken()); System.out.println(x*x); } catch (IOException e) { } } } Inverse (inv)ProblemWrite a program, that for a given string of a length between 1 and 100 writes a string with inversed letters. Solution in Java(INV.java)import java.io.*; public class INV { public static void main(String[] args) { try { BufferedReader rd=new BufferedReader(new InputStreamReader(System.in)); String line=rd.readLine(); for(int i=line.length()-1; i>=0; i--) System.out.print(line.charAt(i)); System.out.println(); } catch (IOException e) { } } } |