![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 #include<iostream> 2 #include<string> 3 #include<sstream> 4 using namespace std; 5 int main(){ 6 int x,n,i=0; 7 long sum; 8 string line; 9 cin>>n; 10 getline(cin,line);//吸取第一行的尾数结束标志 11 while(getline(cin,line)){ 12 istringstream iss(line); 13 sum=0; 14 n=0; 15 while(iss>>x){ 16 sum+=x; 17 n++; 18 } 19 cout<<"Case"<<++i<<": "<<n<<", "<<sum<<endl; 20 } 21 system("pause"); 22 return 0; 23 24 }