Been a long time since i blogged. These days I started dancing :) Totally i think there are three major performances i have done so far in a span of 4 months. The first one was the "One Family Day" event. It was awesome. We managed to reach the finals. The second performance was for Diwali celebrations. We did a Bhangra. And now the third one is on ITS (my team) celebrations held in N Convention. Below is the costume we used for the ITS celebrations' event.
Friday, January 21, 2011
Sunday, January 9, 2011
To print input till output is 42 !
This is a just a problem I found in CodeChef (Thanks a ton to Bittu for introducing this site to me :-)) :-)
Problem :
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.
Code I have tried :
using System;
namespace LifeTheUniverse
{
class ClsCodeChef1
{
static void Main()
{
int a = 0, i = 0;
int[] b = new int[1];
Console.WriteLine("Input:");
while (a != 42)
{
a = Convert.ToInt32(Console.ReadLine());
b[i] = a;
i++;
Array.Resize(ref b, i + 1);
}
Console.WriteLine("Output:");
for (int j = 0; j < i - 1; j++)
Console.WriteLine(b[j]);
Console.Read();
}
}
}
Problem :
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.
Code I have tried :
using System;
namespace LifeTheUniverse
{
class ClsCodeChef1
{
static void Main()
{
int a = 0, i = 0;
int[] b = new int[1];
Console.WriteLine("Input:");
while (a != 42)
{
a = Convert.ToInt32(Console.ReadLine());
b[i] = a;
i++;
Array.Resize(ref b, i + 1);
}
Console.WriteLine("Output:");
for (int j = 0; j < i - 1; j++)
Console.WriteLine(b[j]);
Console.Read();
}
}
}
Wednesday, January 5, 2011
Tuesday, January 4, 2011
Subscribe to:
Posts (Atom)