#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int i=0;
char d=0;
i=5;
d='h';
char *firstName="江";
char *lastName="志";
memset(firstName,0,sizeof(*firstName));
memset(lastName,0,sizeof(*lastName));
char *name = (char *) malloc(strlen(firstName) + strlen(lastName));
strcpy(name, firstName);
strcat(name, lastName);
printf("%s\n", name);
printf("%s\n", i);
printf("%c\n", d);
return 0;
}
incldue <stdio.h>
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
int i,j;
printf("\n小明耍女朋友分数\n");
for(i=0;i<10;i++)
{
if(i!=9)
printf("%d\n",score[i]);
else
printf("%d",score[i]);
}
for(i=8;i>=0;i--)
{
for(j=0;j<10;j++)
{
if(score[j]>score[j+1])
{
int sum;
sum=score[j];
score[j]=score[j+1];
score[j+1]=sum;
}
}
}
printf("\n小明耍女朋友分数按降序排列\n");
for(i=0;i<10;i++)
{
if(i!=9)
printf("%d,",score[i]);
else
printf("%d\n",score[i]);
}
float num;
{
printf("小明耍女朋友最高分%d\n",score[9]);
}
int sum=0;
{
printf("小明耍女朋友最低分%d\n",score[0]);
}
for(i=0;i<10;i++)
{
if(i!=9)
{
sum+=score[i];
}
}
sum+=score[9];
{
printf("小明耍女朋友总分是%d\n",sum);
}
num=(float)sum/10;
{
printf("小明耍女朋友的平均分是%.1f\n",num);
}
int xxx;
printf("\n小明太饥渴了,不管分数在那个阶段都要\n");
return 0;
}
小明耍女朋友分数 67 98 75 63 82 79 81 91 66 84 小明耍女朋友分数按降序排列 63,66,67,75,79,81,82,84,91,98 小明耍女朋友最高分98 小明耍女朋友最低分63 小明耍女朋友总分是786 小明耍女朋友的平均分是78.6 小明太饥渴了,不管分数在那个阶段都要