Home > Back-end >  Please help take a look at the C language
Please help take a look at the C language

Time:04-09

Thank you thank you greatly,

CodePudding user response:

 
Int a=0, aa=0, aaa=0;
While (1)
{
Cin> a;
if(! A) break;
if(! (a % 2)) + + aa, aaa +=a;
}
Cout

CodePudding user response:

 void sum_even (void) 
{
Int num, CNT=0, sum=0;


While (the scanf (" % d ", & amp; Num) & amp; & Num) {
If (num & gt; 0 {
Cnt++;
The sum +=CNT;
}
}

Printf (" sum=% d \ n ", sum);
}

For your reference ~

CodePudding user response:

The scanf=& gt; Cin
Printf=& gt; cout

CodePudding user response:

reference 2 building self-confidence boy reply:
 void sum_even (void) 
{
Int num, CNT=0, sum=0;


While (the scanf (" % d ", & amp; Num) & amp; & Num) {
If (num & gt; 0 {
Cnt++;
The sum +=CNT;
}
}

Printf (" sum=% d \ n ", sum);
}

For reference ~

Can't say, run out??

CodePudding user response:

reference 1/f, the wise know already should good karma response:
 
Int a=0, aa=0, aaa=0;
While (1)
{
Cin> a;
if(! A) break;
if(! (a % 2)) + + aa, aaa +=a;
}
Cout

The whole don't come out aye??

CodePudding user response:

Reference:
 # include 

Int main ()
{
Int ecnt=0, esum=0, n, PCNT=0, psum=0;
While (the scanf (" % d ", & amp; N)==1 & amp; & n!=0) {
If (n % 2==0) {//even
Ecnt++;
Esum +=n;
}
If (n> 0) {//positive
Pcnt++;
Psum +=n;
}

}
Printf (" ecnt=% d, esum=% d \ n ", ecnt, esum);//even accumulative number and and
Printf (" PCNT=% d, psum=% d \ n ", PCNT and psum);//positive accumulative number and and

return 0;
}

CodePudding user response:

reference 4 floor wood ooze ooze response:
Quote: refer to the second floor confident boy reply:
 void sum_even (void) 
{
Int num, CNT=0, sum=0;


While (the scanf (" % d ", & amp; Num) & amp; & Num) {
If (num & gt; 0 {
Cnt++;
The sum +=CNT;
}
}

Printf (" sum=% d \ n ", sum);
}

For reference ~

Can't say, run out?


Don't come out what is the second right?
On the basis of this change, you have hands have a brain, can't change yourself?

CodePudding user response:

 

Int a=0, aa=0, aaa=0;
While (1)
{
STD: : cin> a;
if(! A) break;
if(! (a % 2)) + + aa, aaa +=a;
}
STD: : cout

































































































































































































































Cin> a;==the scanf (" % d ", & amp; A)
Cout CodePudding user response:

 
Int a=0, aa=0, aaa=0;

















While (1)
{

















STD: : cin> a;

















if(! A) break;

















If (a> Aa, aaa +=0) + + a;
}




nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related