#26635: 解答(C++)


weimolin222@gmail.com (林維摩)


#include<iostream>

using namespace std;

int main(){

int m,n;

cin>>m>>n;

int b=0;

for(int i=m;i<n+1;i++){

if(i%2==0){

b=b+i;

}

}

cout<<b;

}

#28816: Re:解答(C++)


yp11051013@yphs.tp.edu.tw (908-21石丞恩)


#include

using namespace std;

int main(){

int m,n;

cin>>m>>n;

int b=0;

for(int i=m;i<n+1;i++){

if(i%2==0){

b=b+i;

}

}

cout<<b;

}


感謝

 

#31942: Re: 解答(C++)


yp11051013@yphs.tp.edu.tw (908-21石丞恩)