Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×
User Journal

Journal Journal: sto.c

#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;
}

Slashdot Top Deals

Uncertain fortune is thoroughly mastered by the equity of the calculation. - Blaise Pascal

Working...