Tags » C#

Photo: Naeto C and His New Born Baby

Super C Season! Naeto C shared a picture of him and his daughter as the couple welcomed their bundle of joy last friday in the UK. 36 more words

HOME

Lirik Christina Grimmie - Must Be Love

Berikut lirik lengkap lagu Christina Grimmie – Must Be Love :

I was sitting at the mall with my friends on a Monday
Saying I was gonna leave this town… 62 more words

C

Oppenheimer's Top Bank Stocks to Buy for the Rest of 2014

If any Wall Street sector has had headline risk for the past year, and some would say five years, it is the banking sector. Despite a horrible public relations nightmare as the “too big to fail” monsters, ongoing litigation and fines over the housing collapse and mortgage nightmare, and incendiary commentary from pundits, the banks are actually fighting their way to solid profitability. 632 more words

Banking & Finance

[EASY] Sum of Primes - CodeEval

Here is the problem: https://www.codeeval.com/open_challenges/4/

And here is my solution. I get 100% with this code.

using System;

class Program
{
    static void Main(string[] args)
    {
        int countOfPrimes = 0, index = 2, sumOfPrimes = 0;

        while (countOfPrimes != 1000)
        {
            if(IsPrime(index))
            {
                countOfPrimes++;
                sumOfPrimes += index;
            }

            index++;
        }

        Console.WriteLine(sumOfPrimes);
    }

    public static bool IsPrime(int number)
    {
        for (int i = 2; i < (number / 2 + 1); i++)
        {
            if((number % i) == 0)
            {
                return false;
            }
        }

        return true;
    }
}
C#

[EASY] Simple Sorting - CodeEval

Here is the problem: https://www.codeeval.com/open_challenges/91/

And here is my solution. I get 100% with this code.

using System;
using System.IO;
using System.Collections.Generic;
using System.Globalization;

class Program
{
    static void Main(string[] args)
    {
        StreamReader reader = new StreamReader(args[0]);
        List<string> lines = new List<string>();
        List<double> numbers = new List<double>();
        char[] separator = new char[] { ' ' };

        using (reader)
        {
            string line = reader.ReadLine();

            while (line != null)
            {
                lines.Add(line);
                line = reader.ReadLine();
            }
        }

        for (int i = 0; i < lines.Count; i++)
        {
            string[] numbersFromLine = lines[i].Split(separator, StringSplitOptions.RemoveEmptyEntries);

            for (int j = 0; j < numbersFromLine.Length; j++)
            {
                double convert = Convert.ToDouble(numbersFromLine[j], CultureInfo.InvariantCulture.NumberFormat);

                numbers.Add(convert);
            }

            numbers.Sort();

            foreach (var number in numbers)
            {
                Console.Write("{0:F3} ", number);            }
            Console.WriteLine();
            numbers = new List<double>();
        }
    }
}
C#

Copy constructor madness

Hi everyone!

Me again and a new portion of c++ madness. This is fairly basic stuff, but a lot of people tend to not know it. 647 more words

C++

& Review: The Vacationers by Emma Straub

“Families were nothing more than hope cast out in a wide net, everyone wanting only the best.”

Book Title: The Vacationers
Author: Emma Straub
Pages: 

910 more words
&amp; Reviews