Skip to content

Instantly share code, notes, and snippets.

@VienosNotes
Created January 26, 2012 16:36
Show Gist options
  • Select an option

  • Save VienosNotes/1683674 to your computer and use it in GitHub Desktop.

Select an option

Save VienosNotes/1683674 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<math.h>
int main (int argc, char** argv) {
char* count = argv[1];
int d = 0;
int ans = 0;
while (*(count++) != '\0');
count -= 2;
do {
ans += (*count - 64) * pow(26, d) - (d - d?1:0);
++d;
} while (count-- != argv[1]);
printf("%d\n", ans);
return 0;
}
//コメント:なぜか動く
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment