#includeint main(){ int sum = 0, val = 0; while (std::cin >> val) { sum += val; } std::cout << "所有的数字的和是 -> " << sum << std::endl; return 0;}
本文共 243 字,大约阅读时间需要 1 分钟。
#includeint main(){ int sum = 0, val = 0; while (std::cin >> val) { sum += val; } std::cout << "所有的数字的和是 -> " << sum << std::endl; return 0;}
转载于:https://www.cnblogs.com/funnyweb/p/6213062.html