codechef help pls

hi everyone,i just compiled my first program live,universe,everything in codechef,got compilation error,though the code is working completely fine in my turbo cpp compiler
enterd the lang as c++(gcc-4 0 0-8)no idea what 4 0 0-8 is!
Q
Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input after reading in the number 42. All numbers at input are integers of one or two digits.
Example

Input:
1
2
88
42
99

Output:
1
2
88

code-
#include
#include
void main()
{clrscr();
int a;
while(1)
{

cin>>a;
if(a!=42)
{
cout< }
else
{
break;
}

}
}

Replies

  • Aman Goyal
    Aman Goyal
    codechef
    Compilation Error

    In file included from /usr/lib/gcc/i486-linux/4.0.1/../../../../include/c++/4.0.1/backward/iostream.h:31, from /sources/tested.cpp:1: /usr/lib/gcc/i486-linux/4.0.1/../../../../include/c++/4.0.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated. /sources/tested.cpp:2:18: error: conio.h: No such file or directory /sources/tested.cpp:20:2: warning: no newline at end of file /sources/tested.cpp:3: error: '::main' must return 'int' /sources/tested.cpp: In function 'int main()': /sources/tested.cpp:4: error: 'clrscr' was not declared in this scope
  • Manish Goyal
    Manish Goyal
    Aman Goyal
    hi everyone,i just compiled my first program live,universe,everything in codechef,got compilation error,though the code is working completely fine in my turbo cpp compiler
    enterd the lang as c++(gcc-4 0 0-8)no idea what 4 0 0-8 is!
    Q
    Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input after reading in the number 42. All numbers at input are integers of one or two digits.
    Example

    Input:
    1
    2
    88
    42
    99

    Output:
    1
    2
    88

    code-
    #include
    #include
    void main()
    {clrscr();
    int a;
    while(1)
    {

    cin>>a;
    if(a!=42)
    {
    cout< }
    else
    {
    break;
    }

    }
    }
    Remove .h from #include
    also remove #include

    because there is no conio.h file in gcc compiler ,also remove clrscr(); function
  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    Conio cannot be included here. If you want, you can use getchar() for getch().

You are reading an archived discussion.

Related Posts

i tried to enable auto mounting by editing the /etc/fstab file but the file's entries arent normal....there should be a 'default' value under the options column which i will relace...
""mechanical engineering seminar topics updated"soft copies available for download".. sonar distance meter Vibration analysis of rotary equipment Non contact power transfer system Design of AC System Automobile Air Conditioning Transfer...
These ideas are on the programming of the brain. We are in the beginning stages of making this a success but i know that it can, already is, and will...
Hi friends thanks for the brotherhood.๐Ÿ˜ Can any one provide clue how to find pdf's of FIDIC..
Samsung Galaxy S II and iPhone 4 are the top rivals in the smartphone arena. Both phones are at par in terms of functionality but have their own differences as...