标签:math.h The 三角形 lse == etc nbsp 不能 argc
#include "stdafx.h" #include <stdio.h>
int main(int argc, char* argv[]) {
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);
putchar(‘\n‘);
return 0; }
#include <stdio.h>
#include <math.h>
int main() {
int year;
int month;
int days;
month=2;
printf("input the year:");
scanf("%d",&year);
if(year%400==0||(year%4==0&&year%100!=0)){
days=29;
printf("year=%d\n",year);
printf("month=%d\n",month);
printf("days=%d\n",days);
}else{
days=28;
printf("year=%d\n",year);
printf("month=%d\n",month);
printf("days=%d\n",days);
}
return 0;}
#include <stdio.h>
#include <math.h>
int main() {
int a;
int b;
int c;
scanf("%d %d %d",&a,&b,&c);
if(a+b>c&&b+c>a&&a+c>b){
if(a==b&&a==c){
printf("等边三角形");
}else if(a==b||a==c||b==c){
printf("等腰三角形");
}else if((a*a+b*b==c*c)||(a*a+c*c==b*b)||(c*c+b*b==a*a)){
printf("直角三角形");
}
}else{ printf("不能构成三角形");
}
return 0; }
#include <stdio.h>
#include <math.h>
int main() {
int a;
scanf("%d",&a);
if(a<500){
printf("a=%d\n",a);
printf("rate=0.00\n");
printf("tax=0\n");
printf("profit=%d\n",a);
}else if(500<=a<1000){
printf("a=%d\n",a);
printf("rate=0.05\n");
printf("tax=%f\n",a*0.05);
printf("profit=%f\n",a*0.95);
}else if(1000<=a<2000){
printf("a=%d\n",a);
printf("rate=0.08\n");
printf("tax=%f\n",a*0.08);
printf("profit=%f\n",a*0.92);
}else if(2000<=a<5000){
printf("a=%d\n",a);
printf("rate=0.10\n");
printf("tax=%f\n",a*0.1);
printf("profit=%f\n",a*0.9);
}else if(5000<=a){
printf("a=%d\n",a);
printf("rate=0.15\n");
printf("tax=%f\n",a*0.15);
printf("profit=%f\n",a*0.85); }
return 0; }
标签:math.h The 三角形 lse == etc nbsp 不能 argc
原文地址:https://www.cnblogs.com/P201821430030/p/10768879.html