Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

朱原东 输出3*3矩阵对角线乘积 #20

Open
mmmmmmmmo opened this issue Oct 28, 2016 · 0 comments
Open

朱原东 输出3*3矩阵对角线乘积 #20

mmmmmmmmo opened this issue Oct 28, 2016 · 0 comments

Comments

@mmmmmmmmo
Copy link

include<stdio.h>

int main()
{
int i, m[9];
for(i=1;i<=9;i++)
{
scanf("%c",&m[i-1]);
}
for(i=1;i<=9;i++)
{
printf("%c",m[i-1]);
if(i%3==0)
{
printf("\n");
}
}
printf("%d\n",m[0]);
printf("按回车输出对角线乘积\n");
getch();
int b=1,a,c,d;
for(a=1;a<=9;a++)
{
if (a%3==0)
{
c=a/3;
d=3;
}
else{
c=a/3;
d=a%3;
}

if (c=d)
{
    b=b*m[a-1];
}
   }
    printf("%d\n",b);

return 0;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant