This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <vector> | |
#include <algorithm> | |
bool myfunc(int a, int b){ | |
if (a>b) return true; | |
return false; | |
} | |
using namespace std; | |
int main(void) | |
{ | |
vector<int> vec; | |
char ch; | |
int i=0; | |
while ( (ch=getchar()) != '\n'){ | |
vec.push_back(ch-'0'); | |
i++; | |
} | |
int N = i; | |
sort(vec.begin(),vec.begin()+N,myfunc); | |
for (int i=0; i<N;i++){ | |
printf("%d",vec[i]); | |
} | |
} |
댓글
댓글 쓰기