Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main () {
- char formarq[3], jogodavelha[2];
- int i, j, n, m, t, s, u, k, pixeldaimagem, g;
- int padrao[3][3];
- int vet[301];
- scanf("%s", formarq);
- scanf("%s", jogodavelha);
- for (i=0; i<3; i++) {
- for (j=0; j<3; j++){
- scanf("%d", &padrao[i][j]);
- }
- }
- scanf("%d %d %d", &n, &m, &pixeldaimagem);
- printf ("P2\n%d %d\n1\n", n*3, m*3);
- for (u=0; u<m; u++) {
- for (t=0; t<n; t++) {
- scanf ("%d", &vet[t]);
- vet[t]= (vet[t]*10)/256; }
- for (s=0; s<3; s++){
- for (t=0; t<n; t++){
- for (k=0; k<3; k++){
- if (vet[t]>padrao[s][k]) {
- printf(" 1"); }
- if (vet[t]<padrao[s][k]) {
- printf(" 0"); }
- }
- }
- printf("\n");
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment