你創建顯示之間幷包括由用戶輸入的兩個數字甚至整數的和一個節目..C++編程的幫助
EX)2和7 =的總和12(2 + 4 + 6)
這就是我到目前爲止!屁股如果u可以只把我在正確的方向,將是有益的
//Advanced30.cpp - displays the sum of the even integers between and
//including two numbers entered by the user
//Created/revised by <your name> on <current date>
#include <iostream>
using namespace std;
int main()
{
// declare variables
int num1 = 0;
int num2 = 0;
int sum= 0;
cout << "Enter the First Number:" << endl;
cin >> num1;
cout << "Enter the Second Number:" << endl;
cin >> num2;
if (num1 > num2)
{
cout << "Invalid entry. Final number must be less than the first number. Please try again." << endl;
}
for (int sum = (((num1 + 1)/2)*2); num1 <= (((num2 + 1)/2)*2) ; sum = 2 + (((num1 + 1)/2)*2))
return 0;
} //end of main function
這是功課? – Keith 2011-03-22 03:44:17
哈哈!兩個人一樣的功課:http://stackoverflow.com/questions/5386904/c-programming-help – 2011-03-22 04:48:33
KAtie你需要按時完成你的功課:http://stackoverflow.com/questions/5385447/c-programming- help-please – 2011-03-22 05:00:00