View Code
 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 } 

 

相关文章:

  • 2021-09-28
  • 2021-10-30
  • 2022-03-10
  • 2021-06-16
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-01
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2022-03-03
  • 2021-09-09
相关资源
相似解决方案