赞
踩
#include <stdio.h>
int main(void)
{
printf("从今天开始入坑C语言");
return 0;
}
#include <stdio.h>
int main(void)
{
int a,b,c;
scanf("%d%d",&a,&b);
c=a+b;
printf("%d",c);
return 0;
}
#include <stdio.h>
int main(void)
{
int x,y;
scanf("%d",&x);
y=2*x*x+x+8;
printf("%d",y);
return 0;
}
#include <stdio.h>
int main(void)
{
int num1,num2,h,c,j,s,y;
scanf("%d%d",&num1,&num2);
h=num1+num2;
c=num1-num2;
j=num1*num2;
s=num1/num2;
y=num1%num2;
printf("%d %d %d %d %d",h,c,j,s,y);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int num;
scanf("%d", &num);
printf("%d %d %d\n", num%10, (num/10)%10, (num/100)%10);
return 0;
}
#include <stdio.h>
int main(void)
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%-9d%-9d%-9d\n",a,a*a,a*a*a);
printf("%-9d%-9d%-9d\n",b,b*b,b*b*b);
printf("%-9d%-9d%-9d",c,c*c,c*c*c);
return 0;
}
#include <stdio.h>
int main(void)
{
int a1,an,d,n;
scanf("%d %d %d",&a1,&an,&d);
n=(an-a1)/d+1;
printf("%d",(a1+an)*n/2);
return 0;
}
#include <stdio.h> int main(void) { int heads,feet,ji,tu; scanf("%d%d",&heads,&feet); for (ji=0;ji<=heads;ji++) { for (tu=1;tu<=heads;tu++) { if (ji+tu==heads && 2*ji+4*tu==feet) printf("%d %d",ji,tu); } } return 0; }
#include <stdio.h>
int main(void)
{
double mei;
scanf("%lf",&mei);
printf("%.2f",mei*6.5573);
return 0;
}
#include <stdio.h>
int main()
{
int math,eng,music;
double aveg;
scanf("%d %d %d",&math,&eng,&music);
aveg=(double)1.00*(math+eng+music)/3;
printf("%.2f",aveg);
return 0;
}
#include <stdio.h>
#define PI 3.14159
int main(void)
{
double r,l,s;
scanf("%lf",&r);
l=r*PI*2;
s=r*r*PI;
printf("%.2f %.2f",l,s);
return 0;
}
#include <stdio.h>
#define PI 3.14159
int main(void)
{
double r,h,s;
scanf("%lf %lf",&r,&h);
s=2*PI*r*r+h*2*PI*r;
printf("%.2f",s);
return 0;
}
#include <stdio.h>
#include <math.h>
int main(void)
{
double x;
scanf("%lf",&x);
x=fabs(x);
printf("%.2f",x);
return 0;
}
#include <stdio.h>
int main(void)
{
double x1,y1,x2,y2,d;
scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
d=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
printf("%.2f",d);
return 0;
}
#include <stdio.h>
#include <math.h>
int main(void)
{
double a, b, c, d, e;
scanf("%lf %lf %lf", &a, &b, &c);
d = 1.0 / 2 * (a + b + c);
e = sqrt(d * (d - a) * (d - b) * (d - c));
printf("%.2lf\n", e);
return 0;
}
#include <stdio.h>
int main(void)
{
int t1,t2,m1,m2,s1,s2,i;
scanf("%2d:%2d:%2d\n%2d:%2d:%2d",&t1,&m1,&s1,&t2,&m2,&s2);
i=(t2*3600+m2*60+s2)-(t1*3600+m1*60+s1);
printf("%d",i);
return 0;
}
#include <stdio.h>
int main(void)
{
int n,i;
double capital;
scanf("%d %lf",&n,&capital);
for (i=1;i<=n;i++)
capital=capital+capital*0.0225;
printf("%.6f",capital);
return 0;
}
#include <stdio.h>
int main() {
int a;
scanf("%d", &a);
printf("%d\n", (int)log10(a) + 1);
return 0;
}
#include <stdio.h>
int main(void)
{
int n;
scanf("%d",&n);
if (n%2==0)
printf("even");
else
printf("odd");
return 0;
}
#include <stdio.h>
int main(void)
{
int num;
scanf("%d",&num);
if (num<30)
printf("%d",num*50);
else
printf("%d",num*48);
return 0;
}
#include <stdio.h>
int main(void)
{
int x,y;
scanf("%d %d",&x,&y);
if (x>=y)
printf("%d %d",y,x);
else
printf("%d %d",x,y);
return 0;
}
#include <stdio.h> int main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); if (a >= b && a >= c) { printf("%d\n", a); } else if (b >= a && b >= c) { printf("%d\n", b); } else { printf("%d\n", c); } return 0; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。