实验二
// 实验二.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <math.h>
int main(int argc, char* argv[])
/*{
putchar(getchar());
putchar(getchar());
putchar(getchar());
putchar(getchar());
putchar(getchar());
putchar('\n');
return 0;
}
{ int a;
printf("input the year\n");
scanf("%d",&a);
if(a%4==0&&a%100!=0||a%400==0)
printf("year:%d,month:2,days:29\n",a);
else
printf("year:%d,month:2,days:28\n",a);
return 0;
}
{ int a,b,c;
void max(int a,int b,int c);
scanf("%d,%d,%d",&a,&b,&c);
if(a+b>c&&a-b<c){
if(a==b&&b==c)
printf("a、b、c构成等边三角形\n");
else if(a==b||a==c||b==c)
printf("a、b、c构成等腰三角形\n");
else if(pow(a,2)+pow(b,2)==pow(c,2)||pow(a,2)+pow(c,2)==pow(b,2)||pow(c,2)+pow(b,2)==pow(a,2))
printf("a、b、c构成直角三角形\n");
else
printf("a、b、c构成一般三角形\n");
}
else
printf("a、b、c不能构成三角形\n");
return 0;
}*/
{ double a,rate,tax,profit;
int b;
scanf("%lf",&a);
b=a/500;
switch(b)
{
case 0:rate=0.00;break;
case 1:rate=0.05;break;
case 2:rate=
case 3:rate=0.08;break;
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:rate=0.10;break;
default:rate=0.15;
}
tax = a*rate;
profit=a-tax;
printf("%lf\n%lf\n%lf\n",rate,tax,profit);
return 0;
}