boj step 7 rework

This commit is contained in:
2024-03-12 17:29:18 +09:00
parent 19b37b6610
commit 91154a5af1
5 changed files with 134 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<string> S;
string temp;
for (int i = 0; i < 5; i++) {
cin >> temp;
S.push_back(temp);
}
bool is_fin = false;
bool flag = false;
int j = 0;
while (!is_fin) {
flag = false;
for (int i = 0; i < 5; i++) {
if (S[i].length() <= j) {
is_fin = is_fin;
continue;
}
flag = true;
cout << S[i][j];
}
if (!flag) is_fin = true;
j++;
}
return 0;
}