作者在 2020-11-24 21:56:12 发布以下内容
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int letter(char);
int main()
{
char ch;
int i;
while((ch=getchar())!=EOF)
{
if(i%10==0)printf("\n");
printf("%c=%d\t",ch,letter(ch));
i++;
}
return 0;
}
int letter(char ch)
{
int a;
a=isalpha(ch);
if(a==0)return -1;
else if(a==1)return ch-'A'+1;
else if(a==2)return ch-'a'+1;
}
#include <string.h>
#include <ctype.h>
int letter(char);
int main()
{
char ch;
int i;
while((ch=getchar())!=EOF)
{
if(i%10==0)printf("\n");
printf("%c=%d\t",ch,letter(ch));
i++;
}
return 0;
}
int letter(char ch)
{
int a;
a=isalpha(ch);
if(a==0)return -1;
else if(a==1)return ch-'A'+1;
else if(a==2)return ch-'a'+1;
}