160809225_ Ye Hua _c Language Programming Experiment 2 Select Structure Programming _ Advanced

Source: Internet
Author: User

#include <stdio.h>#include<math.h>intmain () {inta,b,c,l,p,s; printf ("Please enter three number:"); scanf ("%d%d%d",&a,&b,&c); if(a+b>c && a-b<C) {l=a+b+c; P= (a+b+c)/2; S=sqrt (p* (p-a) * (p-b) * (p-c)); printf ("This three-edged edge can form a triangle: \ n"); printf ("the perimeter of the Triangle is: the area of the%d\n Triangle is:%d", l,s); }    Elseprintf ("This three-edged edge does not make a triangle:"); return 0;} 

#include <stdio.h>intmain () {floata,tax=0, taxincome=0; printf ("Please enter your salary:"); scanf ("%f",&a); if(a<=1455) { tax= (a-3500)*0.03-0; Taxincome=a-tax ; }    Else if(a>1455|| a<=4155) { tax= (a-3500)*0.1- the; Taxincome=a-tax ; }    Else if(a>4155|| a<=7755) { tax= (a-3500)*0.2-555; Taxincome=a-tax ; }    Else if(a<7755|| a<=27255) { tax= (a-3500)*0.25-1005; Taxincome=a-tax ; }    Else if(a>27255|| a<=41255) { tax= (a-3500)*0.3-2755; Taxincome=a-tax ; }    Else if(a>41255|| a<=57505) { tax= (a-3500)*0.35-5505; Taxincome=a-tax ; }    Else{ tax= (a-3500)*0.45-13505; Taxincome=a-tax ; } printf ("you should pay tax this month as:%f\n your post-tax income for this month is:%f\n", tax,taxincome); return 0;}

#include <stdio.h>#include<stdlib.h>#include<time.h>intmain () {intYournumber,mynumber,count=0; Charc;  do{srand (unsigned) Time (NULL)); MyNumber= (rand ()% (101-1)+1);  do{printf ("Please enter the number you are guessing:"); scanf ("%d",&yournumber); Count++; if(yournumber>mynumber) printf ("sorry you guessed it, please re-enter \ n"); Else if(yournumber<mynumber) printf ("sorry you guessed small, please re-enter \ n"); Else if(yournumber==mynumber) printf ("congratulations, you guessed it! : \ n"); Elseprintf ("your number is not valid, please re-enter: \ n"); } while(yournumber!=mynumber); printf ("you guessed it:%d times \ n", count); if(count<=3) printf ("great! You're a genius! \ n"); Else if(count>4&& count<=7) printf ("pro, do not worry, your intelligence is still normal oh! \ n"); Elseprintf ("pro, It is recommended that you do not engage in false IQ activities: \ n");1234567<em id="__mcedel"> printf ("If you still want to continue, please press y| Y, exit Please press n| N:");    Getwchar (); C=Getwchar (); System ("CLS"); }  while(c=='y'|| c=='Y'); return 0;} </em>

This assignment 11 do is the card master can not move in back to the school teacher said but after the completion of my cycle can be a little skilled control only for the other two can not be done independently in many words I did not remember that if you do not automatically come out and can't move, so remember that the basic word is the C language important link

160809225_ Ye Hua _c Language Programming Experiment 2 Select Structure Programming _ Advanced

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.