高手来帮我解决下 C语言的4个题

2025-03-29 19:45:34
推荐回答(2个)
回答1:

第一题:
#include "stdio.h"
main()
{
printf("hello word!");
getch();
}

第二题:
#include "stdio.h"
main()
{
char a=0;
while (a<97 || a>122)
{
printf("please enter the small letter:\n");
a=getchar();
if(a<97 || a>122)
printf("you've entered a wrong word,please enter a right one:\n");
}
putchar(a-32);
getch();
}

第三题:

#include "stdio.h"
main()
{
int i,sum;
sum=2;
for(i=3;i<101;i++)
{
if(i%2==0)
sum=sum+i;
}
printf("The sum is %d",sum);
getch();
}

第四题:相同点,两者都是通过地址存储数据。不同点,数组的元素所指向的数据是在一块连续内存空间中,而指针指向的数据的空间则是没有规律的。

回答2:

太麻烦了!!!!!!!!!