Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marzoukali/f8c793025dfe8ac652c8b699c8810b0a to your computer and use it in GitHub Desktop.
Save marzoukali/f8c793025dfe8ac652c8b699c8810b0a to your computer and use it in GitHub Desktop.
C++ - Simple Problems - Problem 3 - Code With Performance Issue
int count = 0;
for(int a = 0; a < 100; a++)
{
for(int b = 0; b < 100; b++)
{
for(int c = 0; c < 100; c++)
{
for(int d = 0; d < 100; d++)
{
if(a+b+c+d == 100) count++;
}
}
}
}
cout << count;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment