The document contains C++ code that uses nested for loops to print different patterns of the letter "F" within a 7x7 grid. It contains multiple sections that use if/else statements within the for loops to determine where to print "F" or a space for each position in the grid, resulting in several different patterns being outputted.
The document contains C++ code that uses nested for loops to print different patterns of the letter "F" within a 7x7 grid. It contains multiple sections that use if/else statements within the for loops to determine where to print "F" or a space for each position in the grid, resulting in several different patterns being outputted.
The document contains C++ code that uses nested for loops to print different patterns of the letter "F" within a 7x7 grid. It contains multiple sections that use if/else statements within the for loops to determine where to print "F" or a space for each position in the grid, resulting in several different patterns being outputted.
The document contains C++ code that uses nested for loops to print different patterns of the letter "F" within a 7x7 grid. It contains multiple sections that use if/else statements within the for loops to determine where to print "F" or a space for each position in the grid, resulting in several different patterns being outputted.
Download as DOCX, PDF, TXT or read online from Scribd
Download as docx, pdf, or txt
You are on page 1of 2
#include <iostream>
using namespace std;
int main() { for (int r = 0; r <= 6; r++) { for (int s = 0; s <= 6; s++) { if (s == 0 || r == 0 || r == 3) { cout << "F"; } else { cout << " "; } } cout << endl; } cout << "\n";
for (int b = 0; b <= 6; b++)
{ for (int a = 0; a <= 6; a++) { if (b == 0 || a == 0 || b == 3 || a == 6) { cout << "F"; } else { cout << " "; } } cout << endl; } cout << "\n"; for (int b = 0; b <= 6; b++) { for (int a = 0; a <= 6; a++) { if (b == 0 || a == 3) { cout << "F"; } else { cout << " "; } } cout << endl; } cout << "\n";
for (int i = 0; i <= 6; i++)
{ for (int j = 0; j <= 6; j++) { if (i == 0 || i == 6 || j == 3) { cout << "F"; } else { cout << " "; } } cout << endl; } cout << "\n"; for (int m = 0; m <= 6; m++) { for (int n = 0; n <= 6; n++) { if (n == 0 || m == 0 && n == 1 || n == 2 && m == 1 || n == 3 && m == 2 || n == 3 && m == 2 || n == 4 && m == 1 || n == 5 && m == 0 || n == 6) { cout << "F"; } else { cout << " "; } } cout << endl; } cout << "\n"; for (int b = 0; b <= 6; b++) { for (int a = 0; a <= 6; a++) { if (a == 0 || a == 6 || b == 0 || b == 3) { cout << "F"; } else { cout << " "; } } cout << endl; } cout << "\n";