fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. char c;
  7. set<int> S;
  8. while(cin>>n>>c){
  9. S.insert(n);
  10. }
  11. for(set<int>::iterator it=S.begin(); it!=S.end(); it++){
  12. cout<<*it<<",";
  13. }
  14. // your code goes here
  15. return 0;
  16. }
Success #stdin #stdout 0s 4340KB
stdin
1494,1495,1520,1397,1444,1461,1281,1279,1338,1115,1068,1079,1049,1485,1461,1281,1279,1244,1297,1492,1275,1043,1229,1066,1370,1144,1289,1290,1291,1292,1293,1294,1406,1407,1500,1297,1298,1300,1299,1063,1449,1598,1296,1081,1097,1266,1235,1486,1348,1077,1318,1310,1319,1006,1332,1592,1431,1475,1433,1295,1330
stdout
1006,1043,1049,1063,1066,1068,1077,1079,1081,1097,1115,1144,1229,1235,1244,1266,1275,1279,1281,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1310,1318,1319,1332,1338,1348,1370,1397,1406,1407,1431,1433,1444,1449,1461,1475,1485,1486,1492,1494,1495,1500,1520,1592,1598,