Home > other >  C # project will don't know how great god didn't
C # project will don't know how great god didn't

Time:10-02

61. Known to the perimeter of a rectangle is 100, covers an area of 300, strives for the side length of the rectangle?
53. Character array x in any string of characters; Please prepare the function, according to a given alternative relations to replace all the characters in the array x, is still in the array x position, finally calling function x output, the results
Substitution: f (p)=p * 11% 256 (p is an ASCII value of the characters in the array, f (p) is calculated after the new characters of ASCII value), if f (p) after calculation value is less than or equal to g32 or transfering f (p) the corresponding characters are capital letters, the character is the same, otherwise will f (p) of the character to replace,

CodePudding user response:

Can't sink!!!!!!!!!!

CodePudding user response:

1: rectangular circumference is 100, the perimeter algorithm for 2 * (length + width), so the length + width=50 width must be less than 50
Rectangular area 300 is length * width=300 you can use a simple and crude method to calculate the:

Int a=0;//used to record whether meet the conditions for
For (int I=0; I & lt; 50; I++)
{
For (int k=0; K & lt; 50; K++)
{
If (+ k (I)==50 & amp; & (I) * k==300)
{
Console. WriteLine (I + ", "+ k);
a++;
break;
}
}
If (a & gt; 0) break;
}
After running this program, however, is not the result, is this not the answer

CodePudding user response:

I
thank you!With the almost like this

CodePudding user response:

I have a doubt, the title did not say is integer data, so why not answer? Decimal is also possible,
  • Related