650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/9D/DE/wKiom1mH62GxJqLyAABboBpje-o366.png-wh_500x0-wm_ 3-wmp_4-s_3678786343.png "title=" 2017-08-07_11-50-49.png "alt=" Wkiom1mh62gxjqlyaabbobpje-o366.png-wh_50 "/>
To increase understanding, write a few small programs
1: Judging the formation of the triangle and the output of the maximum side practice the first three statements
#include <stdio.h>int main () {int a,b,c;printf ("Enter the triangle three sides long (the edge is an integer, cannot enter a negative number):"); scanf ("%d%d%d", &a, &b,& c) if ((a+b) >c&& (a+c) >b&& (b+c) >a) {printf ("can form a triangle \ n"); if ((a>b&&a>c) | | ((a=b) >c)) printf ("%d\n", a); Else{if (b>a&&b>c) | | ((b=c) >a)) printf ("%d\n", b); elseprintf ("%d\n", c); }}elseprintf ("Cannot form a triangle"); GetChar ();
}
2: Judge the output after the exercise of the two statements
#include <stdio.h>int main () {char a;printf ("Please enter your score level: \ n"), scanf ("%c", &a); switch (a) {case ' a ': printf ("Good" ); Break;case ' B ': printf ("good"); Break;case ' C ': printf ("Pass"); break;default:printf ("Incorrect input"); }}
This article from "Big Plum" blog, reproduced please contact the author!
C Language Learning selection structure programming (third day)