Can I do it in C# instead? It's basically the same thing. :p
using System;
class MyApp
{
public static void Main (string [] args)
{
string Name;
string [] Names;
string FavouriteSubject, LeastFavouriteSubject;
Console.Write("What's your name? ");
Name = Console.ReadLine();
Names = Name.Split(' ');
Console.Write("What's your favourite subject? ");
FavouriteSubject = Console.ReadLine();
Console.Write("What's your least favourite subject? ");
LeastFavouriteSubject = Console.ReadLine();
Console.WriteLine("");
Console.WriteLine("OK, your first name is " + Names[0] + ", your last name is " + Names[Names.Length - 1] + ", your favourite subject is " + FavouriteSubject + " and your least favourite subject is " + LeastFavouriteSubject + ". Have a nice day.";
}
}
I have no idea why I did that, but I enjoyed it. Haven't tested it though, and I wrote it in a text editor so Autocomplete hasn't either.
How many points do you have on Project Euler?