Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

newfags can't

Name: Anonymous 2012-10-07 19:34

SUPERBOLD

Name: Anonymous 2013-05-20 15:02

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>

const char a = "[]!@#$%^&*()1234567890-=abcdefghjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
const char b = "[]!@#$%^&*()1234567890-=abcdefghjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main(void)
{
    char * c = (char*) malloc(10000000 * sizeof(char)); // no one will type ten mibibytes
    char * d = (char*) malloc(10000000 * sizeof(char)); // output
    for(int i = 0; i < 10000000 * sizeof(char) - 1; i++) d[i] = c[i] = '\0';
    printf("String:");
    scanf("%s", &c);
    int l = strlen(c);
    int l2 = strlen(a);
    int matched = 0;
    for(int j = 0; j < l - 1; j++)
    {
        matched = 0;
        for(int k = 0; k < l2 - 1; k++)
        {
            if(c[j] == a[k])
            {
                d[j] = b[k];
                matched = 1;
                break; // we are done here :)
            }
        }
        if(matched == 0) // we didn't match anything :(
        {
            d[j] = c[j];
            continue;
        }
    }
    printf("\a\a\a\a\nDone!\n\n%s%d\r%s",c,sleep(5),d); // show the original, sleep a bit, then use \r to overright the the first with the output

}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List