Skip to content

Instantly share code, notes, and snippets.

@Abreto
Created October 6, 2012 15:31
Show Gist options
  • Save Abreto/3845230 to your computer and use it in GitHub Desktop.
Save Abreto/3845230 to your computer and use it in GitHub Desktop.
枚举法练习
/* E1.2.4 - 售货员. Ural State University Problem Archive 1012 Conductor. */
#include <stdio.h>
int main(void)
{
int i = 0;
double P = 0, Q = 0;
scanf("%lf %lf", &P, &Q);
while(++i, !(( (int)(i * Q/100) - (int)(i * P/100) ) > 0));
return !printf("%d\n", i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment