Compare size
#include <stdio.h>intMain () {inta,b,c,t; printf ("Enter 3 numbers:"); scanf (" %d%d%d",&a,&b,&c); if(a<b) {T=a;a=b;b=T; } if(a<c) {T=a;a=c;c=T; } if(b<c) {T=b;b=c;c=T; } printf ("then they are in the order of %d%d%d", A,b,c); return 0;}
High speed penalty
#include <stdio.h>intMain () {DoubleA,b,c; printf ("Please enter your speed and this lane limit:"); scanf ("%LF%LF",&a,&b); if(b>a&&b<c) {DoubleC= (Double) A * (1+0.1); printf ("Penalty of 200 yuan penalty", c); } Else(a>c) {DoubleC= (Double) A * (1+0.5); printf ("revoke a driver's license", c); } return 0;}
Taxi fare
#include <stdio.h>intMain () {Doublex, Y, Z printf ("Please enter total mileage:"); scanf ("%LF",&x); printf ("Please enter the waiting time:"); scanf ("%LF",&y); if(x<=3) {Z=Ten; } if(x>3&&x<=Ten); {Z= -+ (X-Ten)*3; } if(y<5&&x<=3) {Z=Ten; } if(y<5&& (x>3&&x<=Ten) ) {Z= -+ (X-Ten)*3; } if(y>=5&&x<=3) {Z= (y/5)*2+Ten; } if(y>=5&& (x>3&&x<=Ten) ) {Z= (y/5)*2+ -+ (X-Ten)*3; } return 0;}
Statistics on student achievement
#include <stdio.h>intMain () {Charscore; printf ("Please enter a level"); 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; } return 0;}
Triangle judgment and Perimeter area
#include <stdio.h>intMain () {intA,b,c; floatP,s; scanf (" %d%d%d",&a,&b,&c); if(a+b>c| | a+c>b| | B+c>a) {p= (a+b+c)/2; S=p* (P-A) * (p-b) * (P-c); printf ("s=%f\n", s)} Elseprintf"impossible\n"); return 0;}
Triangle
#include <stdio.h>intMain () {inti,j,k; for(j=1; j<=Ten; j + +) { for(k=Ten;k>Ten-j;k--) {printf (" "); } for(i=1; i<=Ten-j;i++) {printf ("*"); } printf ("\ n"); } return 0;}
Gee homework is more and more difficult, this assignment will not be too many places, I hope the teacher can be a lot of guidance, this C language is too difficult!!
C Language Job 5