1,
#include<stdio.h>
main()
{int a,b,c,t;
printf("input three numbers:\n");
scanf("%d %d %d",&a,&b,&c);/*输入的时候每个整数之间加个空格*/
if(a<b) {t=a;a=b;b=t;}
if(a<c) {t=a;a=c;c=t;}
if(b<c) {t=b;b=c;c=t;}
printf("out numbers:\n%d,%d,%d\n",a,b,c);
}
2,
#include<stdio.h>
main()
{ int i,s=0;
for(i='a';i<='z';i++)
s+=i;
printf("the sum is %d",s);
}
3,
#include<stdio.h>
main()
{int i,j,n=1;
int a[5][5];
for(i=0;i<5;i++)
for(j=0;j<5;j++)
a[i][j]=n++;
for(i=0;i<5;i++)
{
for(j=0;j<=i;j++)
printf(" %d",a[i][j]);
printf("\n");
}
}
4,main()
{ int i,j,n;
for(i=1;i<=9;i++)
{n=1;
for(j=1;j<=i;j++)
printf("%d*%d=%d ",n++,i,n*i);
printf("\n");
}
}
5,
#include<stdio.h>
main()
{
int a,b,c,d,t;
printf("input 4 numbers:\n");
scanf("%d %d %d %d",&a,&b,&c,&d); /*每输入一个数字加个空格*/
if(a<b) {t=b;b=a;a=t;}
if(a<c) {t=c;c=a;a=t;}
if(a<d) {t=d;d=a;a=t;}
printf("the largest number is %d",a);
}