标签:char alt printf amp image putchar else tchar oid
#include<stdio.h>
void main()
{ char a,b,c,d,e;
a=getchar();
b=getchar();
c=getchar();
d=getchar();
e=getchar();
putchar(a);
putchar(b);
putchar(c);
putchar(d);
putchar(e);
}
#include<stdio.h>
void main()
{
int year,days;
scanf("%d",&year);
if ((year%4==0&&year%100!=0)||(year%400==0))
days=29;
else
days=28;
printf("days=%d",days);
}
#include<stdio.h>
void main()
{
int a,b,c;
printf("输入三边\n");
scanf("a=%d,b=%d,c=%d",&a,&b,&c);
if (a+b>c&&a+c>b&&b+c>a)
{printf("true\n");
if (a==b||b==c||a==c)
printf("等腰\n");
else if(a==b&&a==c&&b==c)
printf("等边\n");
else if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a)
printf("直角\n");
else
printf("一般\n");}
else printf("false\n"); }
#include<stdio.h>
void main()
{
double a,rate,tax,profit;
scanf("%lf",&a);
if (a<500)
rate=0;
else if (a<1000)
rate=0.05;
else if (a<2000)
rate=0.08;
else if (a<5000)
rate=0.1;
else
rate=0.15;
tax=a*rate;
profit=a-tax;
printf("a=%lf,rate=%lf,tax=%lf,profit=%lf",a,rate,tax,profit);
#include<stdio.h>
void main()
{
double a,rate,tax,profit;
scanf("%lf",&a);
int b;
b=(int)a/500;
switch(b)
{
case 0:rate=0;break;
case 1:rate=0.05;break;
case 2:
case 3:rate=0.08;break;
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:rate=0.1;break;
default:rate=0.15;
}
tax=a*rate;
profit=a-tax;
printf("a=%lf,rate=%lf,tax=%lf,profit=%lf\n",a,rate,tax,profit);
}
标签:char alt printf amp image putchar else tchar oid
原文地址:https://www.cnblogs.com/P201821430020/p/10768859.html