Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int m[3][3], l, c, aux=0, maior=0, delta=0, aux2=0;
- float media;
- for(l=0; l<3; l++){
- for(c=0; c<3; c++)
- {
- scanf("%d", &m[l][c]);
- if(l == 0 && c == 0) {
- maior = m[l][c];
- }
- if(m[l][c]>maior)
- {
- maior=m[l][c];
- }
- aux+=m[l][c];
- if(maior>=1)
- {
- delta=1;
- }
- else if (maior<0)
- {
- delta=-1;
- }
- else if(maior==0)
- {
- delta=0;
- }
- if(l==c){
- aux2+=m[l][c];
- }
- }
- }
- media = aux/9;
- printf("%.2f ", media);
- printf("%d ", maior);
- printf("%d ", delta);
- printf("%d \n", aux2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement