fork download
  1. #using namespace std;
  2.  
  3. int main() {
  4. int n,i;
  5. cin >>n;
  6. for ( i=0; i<=n/2;i++){
  7. for ( int j1=1;j1<=n-(n-i);j1++)
  8. cout <<".";
  9. for ( int j2=1;j2<=n-2*i;j2++)
  10. cout <<"*";
  11. for ( int j3=1;j3<=n-(n-i);j3++)
  12. cout <<".";
  13. cout <<"\n";
  14. }
  15. for ( i=(n/2)-1; i>=0;i--){
  16. for ( int j1=1;j1<=n-(n-i);j1++)
  17. cout <<".";
  18. for ( int j2=1;j2<=n-2*i;j2++)
  19. cout <<"*";
  20. for ( int j3=1;j3<=n-(n-i);j3++)
  21. cout <<".";
  22. cout <<"\n";
  23. }
  24. return 0;
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
7
compilation info
prog.cpp:1:1: error: ‘include’ does not name a type
 include <iostream>
 ^~~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:6:3: error: ‘cin’ was not declared in this scope
   cin >>n;
   ^~~
prog.cpp:9:6: error: ‘cout’ was not declared in this scope
      cout <<".";
      ^~~~
prog.cpp:11:6: error: ‘cout’ was not declared in this scope
      cout <<"*";
      ^~~~
prog.cpp:13:6: error: ‘cout’ was not declared in this scope
      cout <<".";
      ^~~~
prog.cpp:14:6: error: ‘cout’ was not declared in this scope
      cout <<"\n";
      ^~~~
prog.cpp:18:6: error: ‘cout’ was not declared in this scope
      cout <<".";
      ^~~~
prog.cpp:20:6: error: ‘cout’ was not declared in this scope
      cout <<"*";
      ^~~~
prog.cpp:22:6: error: ‘cout’ was not declared in this scope
      cout <<".";
      ^~~~
prog.cpp:23:6: error: ‘cout’ was not declared in this scope
      cout <<"\n";
      ^~~~
stdout
Standard output is empty