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

 



Forgot your password?
typodupeerror

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).

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

If you don't have time to do it right, where are you going to find the time to do it over?

Working...