160809207 Liu Chaoxuan

Source: Internet
Author: User

#include <stdio.h>intMain () {DoubleJc=1.0; inti;  for(i=1; i<= -; i++) {JC*=i; } printf ("1!+2!+...+20!=%LF", JC);} #include<stdio.h>intIsPrime (intN) {    inti,result=1;  for(i=2; i<n/2; i++)    {        if(n%i==0) {result=0;  Break; }    }    returnresult;}intMain () {intN; scanf ("%d", &N); if(IsPrime (n)) {printf ("0", N); }    Else{printf ("1", N); }    return 0;} #include<stdio.h>#include<math.h>intIsPrime (intN) {     inti;  for(i=2; I<=sqrt (n); i++)          if(n%i==0)return 0; return 1;}intMain () {inti,j,s=0;  for(i=2; i<= -; i++)        if(IsPrime (i)) printf ("%4d", i); return 0;} #include<stdio.h>#include<math.h>intMain () {printf ("Please enter two number: \ n"); intb; scanf ("%d%d",&a,&b); intn=A; if(n>b) N=b;  for(inti=n;i>=1; i--){     if(a%i==0&&b%i==0) {printf ("Greatest common divisor:%d \ n", i);  Break; } }} #include<stdio.h>intMain () {intN,m,i,s,a; printf ("enter any two positive integers:"); scanf ("%d,%d",&n,&m);  for(a=m;a<=m*n;a++)        if(a%m==0&&a%n==0) {printf ("%d\n", a); return 0; }} #include<stdio.h>#include<math.h>floatMax; floatMin; floatAveragefloatB[],intN) {inti; floatTotal ; Max= b[0]; Min= b[0]; Total= b[0];  for(i=1; i<n;i++)      {          if(B[i] >Max) {Max=B[i]; }           if(B[i] <Min) {Min=B[i]; } Total= Total +B[i]; }      returntotal/N; }    intMain () {floatarray[Ten]; inti; floatAve; printf ("Please input 10 people's results, the middle with a space separate: \ n");  for(i=0;i<Ten; i++) {scanf ("%f",&Array[i]); } Ave= Average (Array,Ten); printf ("Highest score is:%6.2f\n", Max); printf ("the lowest score is:%6.2f\n", Min); printf ("The average score is:%6.2f\n", Ave); return 0; }



Experience: This experiment I think the most difficult is the last problem, the original solution to this problem requires three functions, but this time only used one. Just contact with this problem I feel at a loss, do not know how to start, after listening to the teacher in the course of the content and check the information based on the completion. This shows that we are still not deep enough to learn that the real ability can only rely on their own, light on the lesson is far from enough.









160809207 Liu Chaoxuan

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.