Home > Back-end >  1, 2, 4 of 6 8... That sum is not greater than the maximum value of 6000
1, 2, 4 of 6 8... That sum is not greater than the maximum value of 6000

Time:09-26

Vc + + compiler, a little bit more simple as far as possible

CodePudding user response:

Direct write debugging
 
Int aa=0, aaa=0; While (aaa<6000) aaa +=aa +=2; Cout<(aa -=2);

CodePudding user response:

Teacher (on blackboard) : students do not pay attention to listen again ~ ~ ~ 90009 note is sum is not greater than the maximum value of 6000 ! Oh, your IQ short of gaussian 5 levels, directly calculate don't understand, also don't listen to!

 
# include & lt; Stdio. H>
# include & lt; Math. H>

Int main ()
{
Int n=int (SQRT (6000 +) 0.25-0.5).
Printf (" % d \ n ", n * (n + 1));

return 0;
}

CodePudding user response:

Like this have no long eye also since the strategically important place for the teacher, haven't been able to see that writing is the numerical calculated? A buffoon, the somebody else to find a teacher must be looking for a smart, smart people have a plenty of, this world was never a nerd or a buffoon,

CodePudding user response:

references a wise man should know already take good karma, 4/f, response:
like this have no long eye also do teachers since the strategically important place, didn't write to see to is the numerical calculated? A buffoon, the somebody else to find a teacher must be looking for a smart, smart people have a plenty of, this world was never a nerd or a buffoon,

According to your code is should output aaa, aa
Rather than output aa - 2
Sure enough programming language is the most important ability

CodePudding user response:

 
# include & lt; iostream>
Int main ()
{
int sum=0;
Int aa=2;
While (true)
{
The sum +=aa;
If (sum & gt; 6000)
{
STD: : cout & lt; break;
}
Aa +=2;
}

return 0;
}