标签:http out color style cin ima image span 技术分享
#include <iostream> int main() { std::cout<<"请输入N个整数,按Ctrl+Z,然后按Enter结束"<<std::endl; int val = 0 , sum = 0 ; while(std::cin>>val) sum += val ; std::cout<<"你输入的数之和是:"<<sum<<std::endl; return 0; }
输入结束符(Ctrl+Z),或者输入错误(输入小数)结束
标签:http out color style cin ima image span 技术分享
原文地址:http://www.cnblogs.com/guozhikai/p/6100242.html