谁能给我一个最最简单的计算机程序并解释整个程序及符号的意思.
C++的
// The program reads ten numbers, add them together and display the total。
#include //头文件
main() { //主函数
int num, total;//定义变量
total = 0; // initialize the accumulator。 赋值
for (i = 1; I> num; // input a number。
total = total + num; // ...全部
C++的
// The program reads ten numbers, add them together and display the total。
#include //头文件
main() { //主函数
int num, total;//定义变量
total = 0; // initialize the accumulator。
赋值
for (i = 1; I> num; // input a number。
total = total + num; // add the number to total
} // end of while。
cout << total; // output the result。
} // end of the main function。
“//”后为解释
。收起