Guest User

Untitled

a guest
Jan 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.17 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. void funcao_altera(int vetor_linha[], int linhas, int colunas){
  4.  
  5.     int j;
  6.  
  7.     for(j=0;j<(linhas*colunas);j++){
  8.         vetor_linha[j] = ((10*vetor_linha[j])/256);
  9.  
  10.     }
  11. }
  12.  
  13. int B(int m,int l){
  14.     int cont;
  15.  
  16.     if(l>m)
  17.         cont = 1;
  18.     else
  19.         cont = 0;
  20.  
  21. return cont;
  22. }
  23.  
  24.  
  25. int main(){
  26.     int i, j, pixel, linhas, colunas, max, P[9], vetor_linha[3000], a, k, l, c, m;
  27.     char string[3], rasht[2];
  28.  
  29.  
  30.     scanf("%s %s", string, rasht);
  31.  
  32.     for(i=0;i<9;i++){
  33.         scanf("%d", &a);
  34.         P[i] = a;
  35.  
  36.     }
  37.  
  38.     scanf("%d %d %d", &linhas, &colunas, &max);
  39.  
  40.  
  41.  
  42.  
  43.         for(i=0;i<linhas*colunas;i++){
  44.             scanf("%d", &pixel);
  45.             vetor_linha[i]=pixel;
  46.             }
  47.  
  48.  
  49.      funcao_altera(vetor_linha, linhas, colunas);
  50.  
  51.     printf("%s\n%d %d\n1\n", string, linhas*3, colunas*3);
  52.  
  53.  
  54.         for(i=0; i<3;i++){
  55.             for(j=0;j<colunas;j++){
  56.  
  57.                 for(k=i;k<3*i+3;k++){
  58.                     l = vetor_linha[j];
  59.                     m = P[k];
  60.                     printf("%d ", B(m, l));
  61.                 }
  62.             }
  63.             printf("\n");
  64.         }
  65.  
  66.  
  67.  
  68. return 0;
  69. }
Add Comment
Please, Sign In to add comment