#include<iostream> using namespace std; int main(){ int N; cin>>N; for(int i=0;i<=2*N+2;i++){ if(i%(N+1)==0){ cout<<" "; for(int j=1;j<=N;j++){ cout<<"-"; } cout<<" "<<'\n'; } else{ cout<<"|"; for(int j=1;j<=N;j++){ cout<<" "; } cout<<"|"<<'\n'; } } } |
Double click to view unformatted code.