-
The meaning of the title of the first question is not too clear (since they do it in turns and there are no special conditions, don't they all take the same amount of time no matter what they do?). )。
The second question I can help you type**,This is c++**:
include import I/O streams.
include to import the string class.
using namespace std;Use the std namespace.
int main() defines the main function.
string str;Use the string class to define the string str
cin >>str;Enter the string to str
for (int i = 0;i < i++) defines the for loop, with i as the control variable, the initial value is 0, and the judgment condition is i < plus 1 for each i execution
Check whether the ASCII code of str[i] (the i+1st character of str) is between 90 and 65, that is, whether it is an uppercase letter.
str[i] = (char)((int)str[i]) 4);Add 4 to the ascii code of the str[i] character and assign the str[i] character to the char type.
if ((int)str[i]) 90) if it exceeds the range of capital letters.
str[i] = (char)(65 + int)str[i]) 90) -1);65 plus str[i] ASCII code minus 90 difference, subtract 1, and assign str[i] to the char type
Check whether the ASCII code of str[i] (the i+1st character of str) is between 122 and 97, that is, whether it is a lowercase letter.
str[i] = (char)((int)str[i]) 4);Add 4 to the ascii code of the str[i] character and assign the str[i] character to the char type.
if ((int)str[i]) 122) if it exceeds the range of capital letters.
str[i] = (char)(97 + int)str[i]) 122) -1);97 plus str[i] to the ASCII code minus the difference of 122, subtract 1, and assign a value to str[i] to the char type
else if it's not a letter.
Continue without modification.
I've added a note to almost every line of cout to explain what this line is for, and I hope you understand this one thoroughly.
-
First of all, you should make it clear what model the mobile phone is, most of the mobile phones can be retrieved and deleted**, some are logged in the mobile phone in the record, and some are directly deleted in the near future, but the general mobile phone is deleted**There is only one month of storage time, and it can't be retrieved after one I hope it will help you.
-
It is known that the longitude of the two places is 1 and 2, and the latitude is 1 and 2 respectively, and the formula for finding the nearest distance between the two places is:
s=2πrθ/360° (1)
where can be obtained from the following equation:
sin(θ/2)]^2=[sin(φ1-φ2)/2]^2+[sin(σ2-σ1)/2]^2cosφ1cosφ2 (2)
Note: 1. where s is the shortest distance of any two points on the sphere (spherical distance);
2. It is the angle between two points, and when using equation (2), latitude and longitude themselves have plus or minus signs, usually positive north latitude and negative south latitude; The east longitude is positive, and the west longitude is negative.
3. Because the upper and lower subscripts will not be used, 2 in the formula refers to the square; The 1 and sum 2 in cos 1cos 2, 2-1, 1-2 are subscripts.
I think your problem is that you don't know the formula, and after knowing the formula, it's a numeracy problem in C language, so I don't need to teach this.
-
Use the floating-point function to define the four coordinates of 2 points (that is, the latitude and longitude of the ab2 point), and then subtract the latitude and longitude phase to multiply the absolute value by the scale.
Is it called 0th or 1st position next to s2? This is better explained. >>>More
You can add a 0 to the end of the array, but you can't have a 0 in the middle. Then change it to something like this: >>>More
#include
#include >>>More
#include
void main() >>>More
It's nonsense to say so much above. Landlord please see: pay attention to your program: printf("%d,%d",(a,b),(b,a); >>>More