#include <stdio.h>
int main(){ char a[5]; gets(a); puts(a); return 0;}#include <stdio.h>
#include <math.h>
int main()
{ int year,a; printf("请输人年份y:\n"); scanf("%d",&year); if(year%400==0) a=1; else { if(year%4==0&&year%100!=0) a=1; else a=0; } if(a==1) { printf("year=%d month=2 days=29",year); } else { printf("year=%d month=2 days=28",year); } return 0;}#include <math.h>
int main()
{ int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if (a+b>c&&b+c>a&&a+c>b)
{
if (a==b || b==c || a==c)
{
if (a==b&&b==c)
printf("等边\n");
else printf("等腰\n");
}
if(sqrt(a*a+b*b)==c || sqrt(b*b+c*c)==a || sqrt(a*a+c*c)==b)
printf("直角\n");
else printf("一般");
}
else
{
printf("Error\n");
}
return 0;
}
#include <stdio.h>
int main()
{ float a;
float tax,rate,profit;
printf("请输入奖金数:");
scanf("%f",&a);
if(a<500)
{
rate=0.00;
}
else if(500<=a && a<1000) {
rate=0.05;
}
else if(1000<=a && a<2000)
rate=0.08;
else if(2000<=a && a<5000)
rate=0.10;
else if(5000<=a)
rate=0.15;
tax=a*rate;
profit=a-tax;
printf("tax=%f\n",tax);
printf("profit=%f\n",profit);
return 0;
}
#include <stdio.h>
int main()
{
double a;
double tax,rate,profit;
int b;
printf("请输入奖金数:");
scanf("%lf",&a);
b=(int)a/500;
switch (b)
{case 0: tax=0.00*a;break;
case 1:tax=0.05*a;break;
case 2:tax=0.08*a;break;
case 3:tax=0.08*a;break;
case 4:tax=0.10*a;break;
case 5:tax=0.10*a;break;
case 6:tax=0.10*a;break;
case 7:tax=0.10*a;break;
case 8:tax=0.10*a;break;
case 9:tax=0.10*a;break;
default:tax=0.15*a;
}
profit=a-tax;
printf("tax=%lf\n",tax);
printf("profit=%lf\n",profit);
return 0;
}