📜  C++ 中循环的属性及其工作原理 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:55.424000             🧑  作者: Mango

代码示例1
#include 
int main(){

    using namespace std;
    int sum = 0, i, n;

    for(i = 0; i < 10; i++){

        cout << "Enter number" << endl;
        cin >> n;

        sum = sum + n;

    }
    cout << "Sum is " << sum << endl;

    return 0;

}