zoukankan      html  css  js  c++  java
  • caogao

    #include<stdio.h>

    #include<math.h>

    int add(int x,int y){

          int s;

               s=x+y;

               return s;

    }

    int minus(int x,int y){

          int s;

               s=x-y;

               return s;

    }

    int multip(int x,int y){

          int s;

               s=x*y;

               return s;

    }

    int quotient(int x,int y){

          int s;

               s=x/y;

               return s;

    }

    int mod(int x,int y){

          int s;

               s=x%y;

    }

    int main()

    {

       int x,y;

       char c;

       int a,b;

       int r;

       scanf("%d",&x);

       scanf("%c",&c);

       scanf("%d",&y);

       if (c=='+')

                r=add(x,y);

       else if (c=='-')

                r=minus(x,y);

       else if (c=='*')

                r=multip(x,y);

       else if (c=='/')

                r=quotient(x,y);

       else if (c=='%')

       r=mod(x,y);

       printf("The result is %d ",r);

       return 0;

    }

    #include<stdio.h>

    #include<math.h>

    int prime(int n){

    int i,j,k;

    k=sqrt(n);

    if (n==1)

    return 0;

    for (i=2;i<=k;i++)

    {

    if (n%i==0)

    return 0;

    break;

    }

    return 1;

    }

    int main()

    {

       int n;

       scanf("%d ",&n);

       if (prime(n)==1)

                printf("YES ");

       else if (prime(n)==0)

                printf("NO ");

       return 0;

    }

    #include<stdio.h>

    int max2(int a,int b){

             if (a>=b)

    return a;

    else (a<b);

    return b;

    }

    int max4(int a,int b,int c,int d){

    int m,n;

    m=max2(a,b);

    n=max2(c,d);

    return max2(m,n);

    }

    int main(){

    int a,b,c,d,s;

    scanf("%d",&a);

    scanf("%d",&b);

    scanf("%d",&c);

    scanf("%d",&d);

    s=max4(a,b,c,d);

    printf("%d ",s);

    return 0;

    }

    #include<stdio.h>

    int qwe(int n){

             int l;

    if (n==1||n==0)

    l=1;

    else

    l=n*qwe(n-1);

    return l;

    }

    int main(){

    int n;

    scanf("%d ",&n);

    printf("%d ",qwe(n));

    return 0;

    }

  • 相关阅读:
    SP笔记:交叉实现七行并成一行
    HTML tag 学习
    操作哈希表
    Efficient bipedal robots based on passivedynamic walkers
    Pushing People Around
    ZEROMOMENT PONTTHIRTY FIVE YEARS OF ITS LIFE

    Active Learning for RealTime Motion Controllers
    Accelerometerbased User Interfaces for the Control of a Physically Simulated Character
    Dynamic Response for Motion Capture Animation
  • 原文地址:https://www.cnblogs.com/p201821440037/p/10894580.html
Copyright © 2011-2022 走看看