#include "stdio.h" int 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); return 0; }
#include "stdio.h" int main(){ int year; printf("input the year:"); scanf("%d",&year); if(year%4==0&&year%100!=0){ printf("year:%d,month:2,days:29",year);} else if(year%400==0){ printf("year:%d,month:2,days:29",year);} else printf("year:%d,month:2,days:28",year); return 0; }
#include "stdio.h" #include "math.h" int main(){ int a,b,c; printf("请输入三角形的三边:"); scanf("%d%d%d",&a,&b,&c); if(a+b<c||a+c<b||b+c<a) printf("该三边不能构成三角形!"); else if(a==b&&b!=c||b==c&&c!=a||a==c&&c!=b&&(pow(a,2)!=pow(b,2)+pow(c,2)||pow(b,2)!=pow(a,2)+pow(c,2)||pow(c,2)!=pow(b,2)+pow(a,2))) printf("此三角形为等腰三角形。"); else if(a==b&&b==c) printf("此三角形为等边三角形。"); else if((pow(a,2)==pow(b,2)+pow(c,2)||pow(b,2)==pow(a,2)+pow(c,2)||pow(c,2)==pow(b,2)+pow(a,2))&&(a!=b&&b!=c&&c!=a)) printf("此三角形为直角三角形。"); else if((pow(a,2)==pow(b,2)+pow(c,2)||pow(b,2)==pow(a,2)+pow(c,2)||pow(c,2)==pow(b,2)+pow(a,2))&&(a==b||b==c||c==a)) printf("此三角形为等腰直角三角形。"); else printf("此三角形为一般三角形。"); return 0; }
#include "stdio.h" #include "math.h" double main(){ double a,rate,tax,profit; printf("请输入你的奖金数:"); scanf("%lf",&a); if(a<0) printf("请输入正确的奖金数:"); else if(a<500){ rate=0.00; tax=a*rate; profit=a-tax; printf("a=%lf,rate=%lf,tax=%lf,profit=%lf",a,rate,tax,profit);} else if(a>=500&&a<1000){ rate=0.05; tax=a*rate; profit=a-tax; printf("a=%lf,rate=%lf,tax=%lf,profit=%lf",a,rate,tax,profit);} else if(a>=1000&&a<2000){ rate=0.08; tax=a*rate; profit=a-tax; printf("a=%lf,rate=%lf,tax=%lf,profit=%lf",a,rate,tax,profit);} else if(a>=2000&&a<5000){ rate=0.10; tax=a*rate; profit=a-tax; printf("a=%lf,rate=%lf,tax=%lf,profit=%lf",a,rate,tax,profit);} else if(a>=5000){ rate=0.15; tax=a*rate; profit=a-tax; printf("a=%lf,rate=%lf,tax=%lf,profit=%lf",a,rate,tax,profit);} return 0; }