训练目的…………………………………………..
训练时间……………………………………………
训练地点……………………………………………
训练内容……………………………………………
>
void main(void)
{
int a,b,c,max;
scanf("%d,%d,%d",&a,&b,&c);
if(a>b)
max=a;
else
max=b;
if(max<c)
max=c;
printf("%d\n",max);
}
★/*或者*/
#include <>
void main()
{
int a,b,c,max;
scanf("%d,%d,%d",&a,&b,&c);
max=(a>b)?a:b;
max=(max<c)?c:max;
printf("%d\n",max);
}//============================
★/*求sin30'+sin60'+cos30'+cos60'之和。*/
#include <>
#include <>
void main(void)
{
double s,a,b;
a=30*;
b=60*;
s=sin(a)+sin(b)+cos(a)+cos(b);
printf("s=%f\n",s);
}//============================
★/*求一个任意的圆的面积和周长。*/
#define PI
#include <>
void main(void)
{
double r,area,s;
scanf("%f",&r);
area=PI*r*r;
s=2*PI*r;
printf("area=%\ns=%\n",area,s);
}//============================
★/*从键盘输入一个华氏温度,转换成对应的摄氏温度。*/
#include <>
void main(void)
{
float F,C;
scanf("%f",&F);
C=(F-32)*5/9;
printf("C=%f\n",C);
}//============================★/*输入一个三位数,依次输出该数的个位,十位,百位数字。*/
#include <>
void main(void)
{
int x,a,b,c;
scanf("%d",&x);
a=x/100;
b=(x-100*a)/10;
c=(x-100*a)%10;
printf("%d,%d,%d\n",a,b,c);
}//============================★/*从键盘任意输入一个小写字母,将其转换成对应的大写字母和10进制数。*/
#include <>
void main(void)
{
char c1;
c1=getchar();
c1=c1-32;
putchar(c1);
printf("%d\n",c1);
}//============================★/*求s=1!+2!+3!+...+10!*/
#include <>
void main(void)
{
int i;
float s,t;
t=1;
s=0;
for(i=1;i<=10;i++)
{
t*=i;
s+=t;
}
printf("%f\n",s);
}//============================★/*输入n个实数统计其正数,负数之和。*/
#include <>
void main(void)
{
int n,i;
float s,a=,b=;
printf("n=?");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%f",&s);
if(s>0)
a+=s;
else
b+=s;
}
printf("正数之和为%f\n",a);
p
谁是谁的谁的 来自淘豆网m.daumloan.com转载请标明出处.