online advertising

Thursday, October 16, 2014

SPOJ Problem Set (classical) - Life, the Universe, and Everything

Problem:

Please find the problem here.

Solution:

To celebrate I have done with my 42nd problem, I decided to attempt this question. Apparently, this isn't really a question, we can just get it accepted blindfolded - yes, it is that easy :p

Consider this a joke in this blog!

Code:

#include "stdafx.h"

// http://www.spoj.com/problems/TEST/

#include <iostream>

using namespace std;

int SPOJ_TEST()
{
    while (true)
    {
        int x;
        cin >> x;
        if (x != 42)
        {
            cout << x << endl;
        }
        else
        {
            break;
        }
    }

    return 0;
}

No comments :

Post a Comment