?

Log in

))
15 January 2016 @ 12:15 am

#include <iostream>
using namespace std;

int main()

{

  for (int i = 1; i < 21; i++)

  {

      cout << i << " * " << i << " = " << i * i << endl;

  }

}

 
 
))
15 January 2016 @ 12:10 am

#include <iostream>
using namespace std;

int main()

{

  int userData;
   int i = 0;

  do

  {

      cin >> userData;
        i = i + userData;
       cout << i << endl;
     }

  while (userData != 0);
   return 0;
}

 
 
))
14 January 2016 @ 11:58 pm


#include <iostream>
#include <string>

using namespace std;

int main()

{

string password;
 for (int i = 0; i < 3; i ++)

{
   cout << "Enter password: ";
   cin >> password;
   if (password == "qwerty")

    {
       cout << "Welcome, captain!\n$captain_" << endl;
       return 0;

    }

    else

    {
       if (i == 2)

        {
             cout << "You entered wrong password 3 times, try again later." << endl;
             return 0;

        }

        else

        {
             cout << "Password wrong." << endl;

        }

    }

}

}

 
 
))
14 January 2016 @ 10:48 pm

#include <iostream>
#include <string>

using namespace std;

int main()

{

  int bottles = 99;
  for (int i = 0; i < 99; i++)

  {

      cout << bottles << " bottles of beer on the wall, " << bottles << " bottles of beer." << endl;
      bottles--;
      cout << "Take one down, pass it around, " << bottles << " bottles of beer on the wall...." << endl;

  }

  cout << "No more bottles of beer on the wall, no more bottles of beer." << endl;
  cout << "Go to the store and buy some more, 99 bottles of beer on the wall..." << endl;
  return 0;

}

 
 
))
20 October 2015 @ 09:20 am
function swapRedGreen(pixel) {
    if (pixel.getRed() >= pixel.getGreen() + pixel.getBlue()) {
        pixel.setRed(0);
        pixel.setGreen(255);
    }
    return px;
}

var image = new SimpleImage("...");
print(image);

for (var pixel of image.values()) {
      swapRedGreen();
}
print(image);
 
 
Current Location: outa here
Current Mood: creative
Current Music: kyga - Here for You
 
 
 
))
1. Work example by hand.
2. Write down what you did.
3. Find patterns.
4. Check by hand.
5. Translate to code.
6. Run test Cases.
7. Debug Failed test Cases.

® Not mine, just steal it as usual.
 
 
Current Location: outa here
Current Mood: awake
Current Music: Andrae Crouch - Let the Church Say Amen