Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137815 张咏灏 打印菱形 C++ Compile Error 0 MS 0 KB 467 2025-11-22 17:23:43

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int a,c=1; cin>>a; int b=a-1; for(int i=0;i<a;i++){ for(int j=0;j<b;j++){ cout<<" "; } b--; for(int r=0;r<c;r++){ cout<<"*"; } c=c+2; cout<<endl; } c=c-4; b=b+2; f or(int i=0;i<a;i++){ for(int j=b;j>=1;j--){ cout<<" "; } b++; for(int r=c;r>=1;r--){ cout<<"*"; } c=c-2; cout<<endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:37:8: error: 'f' was not declared in this scope
 b=b+2; f
        ^
Main.cc:39:4: error: expected primary-expression before 'int'
 or(int i=0;i