You are viewing a single comment's thread. Return to all comments →
This an alternative to limit the iterations without running for infinity.
if(x11>x22 && v11>v22 || x11<x22 & v11<v22) return flag; else { if(v11>v22) { while(x11<=x22) { if(x11==x22) { flag = "YES"; //return flag; break; } else { x11= x11+v11; x22 = x22+v22; } } } if(v22>v11) { while(x11>=x22) { if(x11==x22) { flag = "YES"; //return flag; break; } else { x11= x11+v11; x22 = x22+v22; } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
This an alternative to limit the iterations without running for infinity.