1*6520748dSLei YU #include <cstdio> 2*6520748dSLei YU #include <string> 3*6520748dSLei YU #include <vector> 4*6520748dSLei YU main(int argc,char ** argv)5*6520748dSLei YUint main(int argc, char** argv) 6*6520748dSLei YU { 7*6520748dSLei YU if (argc < 2) 8*6520748dSLei YU { 9*6520748dSLei YU printf("Usage: %s versions...\n", argv[0]); 10*6520748dSLei YU return 1; 11*6520748dSLei YU } 12*6520748dSLei YU 13*6520748dSLei YU std::vector<std::string> versions(argv + 1, argv + argc); 14*6520748dSLei YU std::string latest; 15*6520748dSLei YU for (const auto& s : versions) 16*6520748dSLei YU { 17*6520748dSLei YU if (latest < s) 18*6520748dSLei YU { 19*6520748dSLei YU latest = s; 20*6520748dSLei YU } 21*6520748dSLei YU } 22*6520748dSLei YU 23*6520748dSLei YU printf("%s", latest.c_str()); 24*6520748dSLei YU return 0; 25*6520748dSLei YU } 26