Q458: The Decoder

// Author: Bluefin

// Accepted at once !!

#include<iostream>
#include<cstdlib>
#include<stdio.h>
#include<string.h>

using namespace std;

int main(int argc, char *argv[])
{
    char ar[250];
    while(gets(ar) != NULL)
    {
        int leng = strlen(ar);
        for(int i = 0; i < leng; i++)
            cout << char(ar[i] – 7);
        cout << endl;
    }
    system(“PAUSE”);
    return EXIT_SUCCESS;
}

2 Responses

  1. //muy bueno, pero este es mas corto y tmb fue aceptado

    #include

    int main(void)
    {char c;
    while(scanf(“%c”,&c)!=EOF)
    {if(c==’\n’) printf(“\n”);
    else printf(“%c”,c-7);
    }
    }

Leave a Reply