Skip to content

Instantly share code, notes, and snippets.

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