问答题
请编写一个函数proc(),它的功能是:将str所指字符串中所有下标为奇数位置的字母转换为大写(若该位置上不是字母,则不转换)。
例如,若输入abcde123,则应输出aBcDe123。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的花括号中填入所编写的若干语句。
试题程序:
#include<stdlib.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
void proc(char*str)
{
}
void main()
{
char tt[81];
system("CLS");
printf("/nPlease enter an string within80 characters:/n");
gets(tt);
printf("/n/nAfter changing,the string
/n%s",tt);
proc(tt);
printf("/nbecomes/n%s/n",tt);
}