ZeroJudge & UVa Online Judge answers
#include using namespace std; #include int main() { int a,b; while(cin>>a>>b) { if(a>b) { int temp=a; a=b; b=temp; } int sum=0; for(int i=a;i<=b;i++) { if(i%2==0) //別種寫法? sum += i; } cout< } return 0; }
No comments:
Post a Comment