I've written the program but I won't give to you straight away. This isn't a homework site. Have you tried something on your own? If you did post it here.
#include<iostream>
usingnamespace std;
int main(){
int positionF = 1; //variable for where the F will be printed each time.
for (int i=1; i<=6; i++){ //this runs 6 times, each for every line
bool printedF = false; //this is to check for each line if the F has been printed or not
for (int j=1; j<=5; j++){
if (positionF==j && printedF==false){
cout<<'F'; //output F if it's in the right place and has not been printed before.
j--; //j-- because we need to output all numbers from 1-5, if this wasn't we would skip a step.
positionF++; //increase positionF
printedF = true; //printedF to true so it won't be outputted again.
}
else{
cout<<j; //if it's not F's time to be output, output j.
}
}
if (i==6){
cout<<'F';
}
cout<<"\n";
}
}