Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lab 10 v1
#include <stdio.h> int main(void) { int A[10][10]={{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}}; int n0c=0,utxp=0,ltxp=0; int xs1=0,xs2=0; int ys1=0,ys2=0; for( xs1=0;xs1<10;xs1++){ for(ys1=0;ys1<10;ys1++){ scanf("%d",&A[xs1][ys1]); } } for(xs2=0;xs2<10;xs2++) for(ys2=0;ys2<10;ys2++){ if(A[xs2][ys2]!=0){ ++n0c; printf("n0c=%d\n",n0c); } if(xs2>ys2&&A[xs2][ys2]!=0){ utxp++; } if(xs2<ys2&&A[xs2][ys2]!=0){ ltxp++; } } if(utxp==0){ printf("The matrix is an upper triangular matrix\n"); } if(ltxp==0){ printf("The matrix is a lower triangular matrix\n"); } printf("Number of Non-Zero #=%d\n",n0c); }
run
|
edit
|
history
|
help
0
Goodone tricky
Polidivisible
date diff sample
C_141105_PuntosTriangulo
Bitwise Operations
Atomic Openmp
CO Assignment 1 Question 4
Rationale Zahlen
A_141211_mayor
coding!!Woo!!