CodePudding user response:
Haven't heard: annexed leveling lineSearched and found
Annexed leveling line _ baidu encyclopedia
Found: if not corresponding to the professional staff, it's very hard to understand the specific logic,
So, need you:
A given input
The calculation logic
Given the expected output
Then others can help you, see if you can convert the python code,
CodePudding user response:
The Console. Write (" please enter A point height=");Double Ha=double. Parse (Console. ReadLine ());
The Console. Write (" please input the elevation of point B=");
Double Hb=double. Parse (Console. ReadLine ());
List
List
int i=1;
Do
{
The Console. Write (" please enter the first {0} length/kilometers per unit & lt; Directly enter end input & gt;=", I);
String STR=Console. ReadLine ();
If (STR!="")
{
Collection route length. The Add (double. Parse (STR));
}
The else
{
break;
}
Console. Write (" please input the {0} segment elevation difference=", i++);
Line segment elevation difference set. The Add (double. Parse (the Console. The ReadLine ()));
} the while (true);
//calculate level line closure
Double w=0;
Double the length=0;
For (int j=0; J & lt; Collection route length. The Count; J++)
{
W +=line segment elevation difference set [j];
The total length +=route length set [j];
}
W=w - (Hb - Ha);//closure
Double v=- w/total length;//correct number per kilometer
//calculate each point elevation
Double H=Ha;
For (int j=0; J & lt; Collection route length. The Count; J++)
{
H +=[j] + v * line segment elevation difference set route length set [j];
Console. WriteLine (" P {0} point elevation is: {1} ", j + 1, H);
}
Console. WriteLine (" the last point is the point B!" )
CodePudding user response: