Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void funcao_altera(int vetor_linha[], int linhas, int colunas){
- int j;
- for(j=0;j<(linhas*colunas);j++){
- vetor_linha[j] = ((10*vetor_linha[j])/256);
- }
- }
- int B(int m,int l){
- int cont;
- if(l>m)
- cont = 1;
- else
- cont = 0;
- return cont;
- }
- int main(){
- int i, j, pixel, linhas, colunas, max, P[9], vetor_linha[3000], a, k, l, c, m;
- char string[3], rasht[2];
- scanf("%s %s", string, rasht);
- for(i=0;i<9;i++){
- scanf("%d", &a);
- P[i] = a;
- }
- scanf("%d %d %d", &linhas, &colunas, &max);
- for(i=0;i<linhas*colunas;i++){
- scanf("%d", &pixel);
- vetor_linha[i]=pixel;
- }
- funcao_altera(vetor_linha, linhas, colunas);
- printf("%s\n%d %d\n1\n", string, linhas*3, colunas*3);
- for(i=0; i<3;i++){
- for(j=0;j<colunas;j++){
- for(k=i;k<3*i+3;k++){
- l = vetor_linha[j];
- m = P[k];
- printf("%d ", B(m, l));
- }
- }
- printf("\n");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment