填空题:请补充main()函数,该函数的功能是:把一个字符串中的所有小写字母字符全部转换成大写字母字符,其他字符不变,结果保存在

  • 题目分类:C语言
  • 题目类型:填空题
  • 查看权限:VIP
题目内容:
请补充main()函数,该函数的功能是:把一个字符串中的所有小写字母字符全部转换成大写字母字符,其他字符不变,结果保存在原来的字符串中。
例如,当str[M]=”abcdefl23ABCD”,结果输出:“ABC
DEF123ABCD”。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#define M 80
void main()
{
intj;
char str[M]=" abcdefl23ABCD”;
char *pf=str;
system(”CLS”):
printf(”***original string *** \n”):
puts(str);
【1
while(*(pf+j))
{
if(*(pf+j)>='a' &&*(pf+j)<='Z')
{
*(pf+j)=【2
【3
)
else
j++;
)
printf(”****new string****\n”);
puts(str);
system(”pause”);}
参考答案:
答案解析:

Absences in 2003 first overtook 2002's figures in August ,

Absences in 2003 first overtook 2002's figures in August , but they ended the p

查看答案

Before deciding to buy a new computer, David Thompson wants

Before deciding to buy a new computer, David Thompson wants to find out whether

查看答案

ANNUAL REPORT

ANNUAL REPORTPerformance of last year: (16)__________, sales and profits fell,

查看答案

Domestic sales were higher than foreign sales for the second

Domestic sales were higher than foreign sales for the second month running, whi

查看答案