fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int size=_;
  6.  
  7. for(int row = 0;row<size;row++) {
  8. for(int col = 0;col<size;col++) {
  9. if(col==row){
  10. count<<*;
  11. } else {
  12. count <<“ “;
  13. }
  14. }
  15. count<<endl;
  16. }
  17. return 0; }
  18.  
Success #stdin #stdout 0.03s 25108KB
stdin
Standard input is empty
stdout
#include<iostream>
using namespace std;

int main() {
   int size=_;

   for(int row = 0;row<size;row++) {
    for(int col = 0;col<size;col++) {
     if(col==row){
       count<<“*”;
      } else {
        count <<“ “;
        }
}
count<<endl;
}
return 0; }