forked from bucketzxm/Acm-icpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path132.cpp
81 lines (71 loc) · 1.6 KB
/
132.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include <iostream>
#include <sstream>
#include <ios>
#include <iomanip>
#include <functional>
#include <algorithm>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cctype>
using namespace std;
#define XINF INT_MAX
#define INF 0x3FFFFFFF
#define MP(X,Y) make_pair(X,Y)
#define PB(X) push_back(X)
#define REP(X,N) for(int X=0;X<N;X++)
#define REP2(X,L,R) for(int X=L;X<=R;X++)
#define DEP(X,R,L) for(int X=R;X>=L;X--)
#define CLR(A,X) memset(A,X,sizeof(A))
#define IT iterator
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<PII> VII;
typedef vector<int> VI;
int main()
{
ios::sync_with_stdio(false);
string str;
int cse = 1;
while(getline(cin,str,'\n'))
{
int len = str.length();
vector<int> ans;
ans.clear();
for(int i=0;i<len;i++)
{
int flag = 0;
int num = 0;
while( isdigit(str[i]))
{
flag =1;
num = num*10 + str[i]-'0';
i++;
}
if(flag)
ans.push_back(num);
}
cout<<"Case "<<cse++<<": ("<<ans.size()<<") ";
if(ans.size()>0)
{
for(int i=0;i<ans.size()-1;i++)
{
cout<<ans[i]<<" ";
}
cout<<ans[ans.size()-1]<<endl;
}
else
cout<<endl;
}
return 0;
}