会c语言的帮我一忙!!!

来源:百度知道 编辑:UC知道 时间:2024/06/19 18:36:29
帮我做一下,我刚学2次课, 老师就给我留了这些作业, 不懂~ (vc6)

任意输入一个字符,判断是不是字母

任意三个数 按由小到大的顺序排序

#include <stdio.h>
#include <stdlib.h>
void main()
{
char c;
int x[3],tmp,i,j;
printf("input a character please: \n");
scanf("%c",&c);
if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')
{printf("It is a ZiMu\n"); }
else printf("It is not a ZiMu\n");

printf("input 3 int data: \n");
for(i=0;i<3;i++) scanf("%d",&x[i]);

for (i=0;i<2;i++) for (j=i+1;j<3;j++)
if (x[j] < x[i]) { tmp = x[i];x[i]=x[j];x[j]=tmp;}

for (i=0;i<3;i++) printf("%d ",x[i]);
printf("\n");
system("pause");
}

#include <stdio.h>

int main()
{
char temp;
while(1)
{
temp = getchar();
if((temp<='Z'&&temp>='A')||(temp<='z'&&temp>='a')