Codeforces Round #822 (Div. 2) 1734B - Bright, Nice, Brilliant Solution
Problem Link: https://codeforces.com/problemset/problem/1734/B
Solution in C++:
- /// La ilaha illellahu muhammadur rasulullah
 - ///******Bismillahir-Rahmanir-Rahim******///
 - /// Abul Hasnat Tonmoy
 - /// Department of CSE,23rd batch
 - /// Islamic University,Bangladesh
 - ///**********ALLAH IS ALMIGHTY************///
 - #include <bits/stdc++.h>
 - using namespace std;
 - int main() {
 - int n, i, j, t;
 - cin >> t;
 - while (t--) {
 - cin >> n;
 - for (int i = 1; i <= n; i++) {
 - for (int j = 1; j <= i; j++) {
 - if (j == 1 || j == i)
 - cout << "1 ";
 - else
 - cout << "0 ";
 - }
 - }
 - cout << endl;
 - }
 - }
 


No comments