#include<stdio.h> int main() { printf("* * * * * * * * * *\n"); printf(" * * * * * * * * *\n"); printf(" * * * * * * * *\n"); printf(" * * * * * * *\n"); printf(" * * * * * *\n"); printf(" * * * * *\n"); printf(" * * * *\n"); printf(" * * *\n"); printf(" * *\n"); printf(" *\n"); return 0; }
#include<stdio.h> int main() { char score; scanf("%c",&score); switch (score) { case ‘A‘: printf("90~100"); break; case‘B‘: printf("80~89"); break; case‘C‘: printf("70~79"); break; case ‘D‘: printf("60~69"); break; case(‘E‘): printf("0~59"); break; } }
include<stdio.h> int main() { int F=100; int C; C=(5*(F-32)/9); printf("%d",C); return 0; }
#include<stdio.h> int main() { int t=2; int g=20; int H; H=0.5*g*t*t; printf("f(t)=%d",H); return 0; }
#include<stdio.h> int main() { int a,b,c,d; a=152; b=a/100; c=(a/10)%10; d=a%10; printf(" 百位%d 十位%d 个位%d",b,c,d); return 0; }
#include<stdio.h> #include<math.h> int main() { double x; double y; scanf("%lf",&x); if(x>=0) y=sqrt(x); else y=pow(x+1,2)+2*x+1/x; printf("f(x)=%f",y); }
#include<stdio.h> #include<math.h> int main() { int year; int money; double rate; double interest; printf("请输入存期"); scanf("%d",&year) ; printf("请输入存款金额") ; scanf("%d",&money); printf("年利率"); scanf("%lf",&rate); interest=money*pow(1+rate,year)-money; printf("到期利息为%f",interest); }
#include<stdio.h> int main() { double x; double y; scanf("%lf",&x); if(x<=50) y=0.53*x; else y=0.53*50+(x-50)*0.58; printf("f(x)=%f",y); }
#include<stdio.h> int main()十行三角形 { printf("*\n"); printf("* *\n"); printf("* * *\n"); printf("* * * *\n"); printf("* * * * *\n"); printf("* * * * * *\n"); printf("* * * * * * *\n"); printf("* * * * * * * *\n"); printf("* * * * * * * * *\n"); printf("* * * * * * * * * *\n"); return 0; }
#include<stdio.h> int main()//十行十列矩形 { printf("* * * * * * * * * *\n"); printf("* * * * * * * * * *\n"); printf("* * * * * * * * * *\n"); printf("* * * * * * * * * *\n"); printf("* * * * * * * * * *\n"); printf("* * * * * * * * * *\n"); printf("* * * * * * * * * *\n"); printf("* * * * * * * * * *\n"); printf("* * * * * * * * * *\n"); printf("* * * * * * * * * *\n"); return 0; }
时间: 2024-10-18 06:28:06