| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 158613 | 陈襗葳 | 放大的X | C++ | Compile Error | 0 MS | 0 KB | 835 | 2026-08-22 15:34:09 |
#includ<bits/stdc++.h> using namespace std; int main(){ int t,n; scanf("%d",&t); int i,j,k; int num; //记录该行打印了几个X? for(i=0;i<t;i++){ scanf("%d",&n); for(j=0;j<n;j++){ num = 0; //默认该行没有打印X for(k=0;k<n;k++){ if(j==k||j+k==n-1){ printf("X"); num++; if(j==n/2&&k==n/2){//有一种特殊情况 num = 2; } }else{ if(num!=2){ //每行的最后都无空格 printf(" "); } } } printf("\n"); } printf("\n"); } return 0; }
Main.cc:1:2: error: invalid preprocessing directive #includ
#includ
^
Main.cc: In function 'int main()':
Main.cc:5:18: error: 'scanf' was not declared in this scope
scanf("%d",&t);
^
Main.cc:14:31: error: 'printf' was not declared in this scope
printf("X");
^
Main.cc:21:35: error: 'printf' was not declared in this scope
printf(" ");
^
Main.cc:26:24: error: 'printf' was not declared in this scope
printf("\n");
^
Main.cc:28:20: error: 'printf' was not declared in this scope
printf("\n");
^