C++/알고리즘
c++ 알고리즘 문자열 중 가장 큰 문자 출력
mr.k0
2016. 3. 29. 09:56
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <iostream> using namespace std; int main() { char input[100], temp=0; while(1) { cout << "입력:"; cin >> input; for (int i = 0; input[i] != NULL; i++) { temp = (temp < input[i]) ? input[i] : temp; } cout << temp<<"\n"; } } | cs |