【发布时间】:2018-08-19 12:42:50
【问题描述】:
我在这个 c++ 程序中遇到多个声明错误
#include<iostream.h>
#include<conio.h>
void main ()
{ clrscr();
int a[10][10],r,q,i;
cout<<"enter how many rows and colomn you want in the matrix:";
cin>>n;
cout<<"enter the matrix \n";
for(int r=0;r<n;++r)
{
for(int q=0;q<n;++q)
{
cin>>a[r][q];
}
}
for(int i=0;i<n;i++)
{ cout<<"\n the diagnol elements are:";
cout<<a[n-i-1][i];
}
getch();
}
这是一个在矩阵中查找诊断元素的程序
【问题讨论】:
-
无法复制,请提供minimal reproducible example
-
相关:Why doesn't a simple “Hello World”-style program compile with Turbo C++? 这是一个简单的示例,但 C++ 和 Turbo C++ 之间存在许多您可能会遇到的差异。我的建议是让你分而治之。备份您的源文件,然后开始删除代码片段以帮助您缩小问题的确切原因。