int 높이, 거리; bool 최고고도도달=false; while(높이>0) { if(최고고도도달==false) { 높이++; } else { 높이--; } 거리++; ballx=거리; bally=높이; }