Forgot your password?
typodupeerror
User Journal

Journal: sto.c

Journal by mahadiga
#include <stdio.h>
#include <stdlib.h>

static char* t = "abcdefghijklmnopqrstuvwxyz";
static char* tt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main(int a, char** v)
{
  int i,j;
  int r = 0;

if (a < 2)
{
perror("argv");
exit(0);
}

for (i=0; i<strlen(v[1]); i++)
{
    for (j=0; j<strlen(t); j++)
    {
        if (v[1][i] == t[j] || v[1][i] == tt[j]) r = r+j+1;
        else continue;
    }
}

printf("%d\n",r);
return 0;
}

"You need tender loving care once a week - so that I can slap you into shape." - Ellyn Mustard

Working...