|
|
back to boardI dont understand test number 3 Whats wrong with my code? #include <stdlib.h> #include <math.h> #include <vector> #include <iostream> #include <string> #include <fstream> #include <algorithm> #include <utility> #include <stdlib.h> #include <set> using namespace std; bool normal (float, float); int main() { float begin, end, y1, y2; int counter = 1; scanf ("%f %f", &begin, &end); do{ y1 = (begin*counter)/100; y2 = (end*counter)/100; if (normal(y1, y2)){ printf ("%i\n", counter); return 0; } counter++; } while (true); return (0); } bool normal (float a, float b){ if (ceil(a)<=(float)b) return true; else return false; } |
|
|