c函数●写一个函数,完成如下功能: 输入:一个字符串。其中,字符串中仅可能含有大写英文字母,即A-Z。

1个回答

  • 供参考……

    #include "stdio.h"

    #include "string.h"

    void main(){

    char Str[120],cx,Letter[][2]={{'A',0},{'B',0},{'C',0},{'D',0},{'E',0},{'F',0},{'G',0},

    {'H',0},{'I',0},{'J',0},{'K',0},{'L',0},{'M',0},{'N',0},

    {'O',0},{'P',0},{'Q',0},{'R',0},{'S',0},{'T',0},{'U',0},

    {'V',0},{'W',0},{'X',0},{'Y',0},{'Z',0}};

    int ln,i,j,k;

    printf("请输入一个大写字母字符串...nStr=");

    ln=strlen(gets(Str));

    for(i=0;i