https://codeforces.com/contest/1734/problem/B
문제에서는 자꾸 틀렸다고 나와서 어느 부분에서 틀렸는지 봐주실수 있나요?
#include <iostream> #include <vector> using namespace std; int main() { int t, n; cin >> t; for (int i = 0; i < t; i++) { vector<string> vc; string str; cin >> n; for (int j = n; j > 0; j--) { str = "1"; for (int k = 0; k < n - j - 1; k++) { str += "0"; } if (j != n) str += "1"; vc.push_back(str); } for (auto j : vc) { cout << j << endl; } } }
공백이 아니고 endl로 출력해서 그런가요 ?
지금 다시보니까 중간에 공백이없네요 ㅋㅋㅋ ㅠㅠ 감사합니다
endl 대신 스페이스로 출력하고 테케 마지막에 개행을 넣으면 맞을거임
개행으로 endl 썻는데 중간에 1 0 1 로 해야하는데 101 로 넣어버렸네요...ㅠㅠ 답변 감사합니다