Submission #2165279
Source Code Expand
#include <iostream> using namespace std; int main(){ char S[5], temp; int N, i, j; for(i=0;i<5;i++) cin >> S[i]; for(i=0;i<4;i++){ for(j=i;j<4;j++){ if((S[j]>S[j+1]){ temp = S[j+1]; S[j+1] = S[j]; S[j] = temp; } } } } cout << S[0] << S[1] << S[2] << S[3] << S[4] << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - 25個の文字列 |
User | gobeyond |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 382 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:10:27: error: expected ‘)’ before ‘{’ token if((S[j]>S[j+1]){ ^ ./Main.cpp:15:11: error: expected primary-expression before ‘}’ token } ^ ./Main.cpp: At global scope: ./Main.cpp:18:2: error: ‘cout’ does not name a type cout << S[0] << S[1] << S[2] << S[3] << S[4] << endl; ^ ./Main.cpp:19:1: error: expected declaration before ‘}’ token } ^