Skip to content

Instantly share code, notes, and snippets.

@mkamotsu
Created July 17, 2013 07:14
Show Gist options
  • Save mkamotsu/6018331 to your computer and use it in GitHub Desktop.
Save mkamotsu/6018331 to your computer and use it in GitHub Desktop.
満場一致でBのほうが書きやすい/読みやすいと言われたけどマジなの……
#include <stdio.h>
void A(void) {
int i;
for (i=0; i<100; ++i) {
printf("%d %g %g\n", i, (i / 10 + 1) * 0.1, (i % 10 + 1) * 0.1);
}
}
void B(void) {
int i = 0;
double alpha;
double beta;
for (alpha=0.1; alpha<1.0; alpha+=0.1) {
for (beta=0.1; beta<1.0; beta+=0.1) {
printf("%d %g %g\n", i, alpha, beta);
++i;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment