我们物联网专业的嵌入式实习-day02(开发智能家居系统-计算机的基本结构)

 今天的学习内容在我上传的资源里面
我提供下链接供参考
http://download.csdn.net/download/lsy888520/10125331


相关代码 
1.c

#include
#include


#define N 31


int main()
{
char arr[N];
printf("please input string Length of 1 to 30.\n");


gets(arr);


// do
// {
int i, M;
M = strlen(arr);
for(i = 0; i < M; i++)
{
if(arr[i] >= '0' && arr[i] <= '9')
{
continue;
}
else
{
if(arr[i] >= 'a' && arr[i] <= 'z')
{
arr[i] -= 32;
}
else
{
arr[i] += 32;
}
}
}
// }while(arr[i] != '\0');


puts(arr);
}


2.C
#include


#define N 10
int main()
{
float score[N], average = 0;
printf("input 10 score!\n");


int i;
for(i = 0; i < N; i++)
{
// printf("%d"+".", i + 1);
scanf(" %f", &score[i]);
}
printf("\n");


// sort
int j;
for(i = 0; i < N-1; i++)
{
for(j = 0; j < N-i-1; j++)
{
if(score[j] > score[j+1])
{
float temp = score[j];
score[j] = score[j+1];
score[j+1] = temp;
}
}
}
printf("after max and min sort\n");


// average
for(i = 1; i < N-1; i++)
{
average += score[i];
printf(" %2.2f", score[i]);
}


average = average/8.0;


printf("\nfinal score is %2.2f\n", average);




return 0;


}

你可能感兴趣的:(我们物联网专业的嵌入式实习-day02(开发智能家居系统-计算机的基本结构))