/T6/
#include<stdio.h>
char up(char ch){
char x;
if(ch>='a'&&ch<='z')
x='A'+ch-'a';
printf("%c\n",x);
return x;
}
int main()
{
char a;
scanf("%c",&a);
up(a);
return 0;
}
/T10/
#include<stdio.h>
#include<math.h>
int main()
{
float a,b,c,p,s;
int x=1;
printf("请输入三角形的三条边a,b,c:\n");
scanf("%f%f%f",&a,&b,&c);
while(x)
{
p=(a+b+c)/2;
if((a+b>c)&&(a+c>b)&&(b+c>a))
x=0;
else
{
x=1;
printf("给出的三条边不合理,请重新输入三条边:");
scanf("%f%f%f",&a,&b,&c);
}
}
s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("是三角形\n");
printf("三角形面积为:%.2f",s);
return 0;
}
/T14/
#include<stdio.h>
int Reverse(unsigned int s)
{
int k=0;
if(s%10!=0)
{
while(s!=0)
{
k=k*10+s%10;
s=s/10;
}
printf("%d\n",k);
}
else if(s%10==0)
{
while(s%10==0)
{
s=s/10;
printf("0");
}
while(s!=0)
{
k=k*10+s%10;
s=s/10;
}
printf("%d",k);
}
return s;
}
int main()
{
unsigned int a;
while(1)
{
printf("ÊäÈëÒ»¸öÊý£º\n");
scanf("%d",&a);
Reverse(a);
}
return 0;
}
/T15/
#include<stdio.h>
int main()
{
int a[10]={7,8,11,13,17,21,27,31,35};
int i,j,k,n=a[9];
printf("请输入一个数:");
scanf("%d",&a[9]);
for(j=0;j<=9;j++)
{
for(i=0;i<9-j;i++)
{
if(a[i]>a[i+1])
{
k=a[i];
a[i]=a[i+1];
a[i+1]=k;
}
}
}
for(i=0;i<=9;i++)
printf("%d ",a[i]);
return 0;
}
![难过](http://static.blog.csdn.net/xheditor/xheditor_emot/default/sad.gif)
![委屈](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wronged.gif)
![快哭了](http://static.blog.csdn.net/xheditor/xheditor_emot/default/fastcry.gif)
![哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/cry.gif)
![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
![难过](http://static.blog.csdn.net/xheditor/xheditor_emot/default/sad.gif)
![委屈](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wronged.gif)
![快哭了](http://static.blog.csdn.net/xheditor/xheditor_emot/default/fastcry.gif)
![哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/cry.gif)
![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
![难过](http://static.blog.csdn.net/xheditor/xheditor_emot/default/sad.gif)
![委屈](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wronged.gif)
![快哭了](http://static.blog.csdn.net/xheditor/xheditor_emot/default/fastcry.gif)
![哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/cry.gif)
![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
![难过](http://static.blog.csdn.net/xheditor/xheditor_emot/default/sad.gif)
![委屈](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wronged.gif)
![快哭了](http://static.blog.csdn.net/xheditor/xheditor_emot/default/fastcry.gif)
![哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/cry.gif)
![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
![难过](http://static.blog.csdn.net/xheditor/xheditor_emot/default/sad.gif)
![委屈](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wronged.gif)
![快哭了](http://static.blog.csdn.net/xheditor/xheditor_emot/default/fastcry.gif)
![哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/cry.gif)
![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
![难过](http://static.blog.csdn.net/xheditor/xheditor_emot/default/sad.gif)
![委屈](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wronged.gif)
![快哭了](http://static.blog.csdn.net/xheditor/xheditor_emot/default/fastcry.gif)
![哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/cry.gif)
![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
![难过](http://static.blog.csdn.net/xheditor/xheditor_emot/default/sad.gif)
![委屈](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wronged.gif)
![快哭了](http://static.blog.csdn.net/xheditor/xheditor_emot/default/fastcry.gif)
![哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/cry.gif)
![大哭](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
![难过](http://static.blog.csdn.net/xheditor/xheditor_emot/default/sad.gif)
![委屈](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wronged.gif)
![快哭了](http://static.blog.csdn.net/xheditor/xheditor_emot/default/fastcry.gif)
/T17/
#include<stdio.h>
int main()
{
while(1)
{
int a[10];
int i;
float s=0,m;
printf("请输入十个数\n");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
s=s+a[i];
}
m=s/10;
printf("%f",m);
}
return 0;
}
#include<stdio.h>
int main()
{
int p=0,i;
float sum=0,max,average,a[10];
printf("请输入10名同学的C++成绩");
for(i=0;i<10;i++)
{
scanf("%f",&a[i]);
}
max=a[0];
for(i=0;i<10;i++)
{
if(max<=a[i])
{
max=a[i];
}
}
for(i=0;i<10;i++)
{
sum=sum+a[i];
}
average=sum/10;
for(i=0;i<10;i++)
{
if(a[i]>=60)
{
p++;
}
}
printf("最高分%.2f平均分%.2f及格人数%d",max,average,p);
return 0;
}